File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ function testCtypeDigit($a, $ex) {
60
60
* スペース含みが許可される
61
61
* 正の整数に+符号が許可される
62
62
* -1が許可される
63
- * PHP_INT_MAX +1, PHP_INT_MIN がおかしい
63
+ * INT範囲外がNG
64
64
* @dataProvider provideParams
65
65
*/
66
66
function testFilterVar ($ a , $ ex ) {
@@ -86,4 +86,21 @@ function testCake3($a, $ex) {
86
86
function testIsGteZeroInteger ($ a , $ ex ) {
87
87
$ this ->assertSame ($ ex , \Puyo \Util \Strings::isGteZeroInteger ($ a ), "' $ a' " );
88
88
}
89
+
90
+ /**
91
+ * Laravel5.5 integer
92
+ *
93
+ * +-符号やスペースが許可される
94
+ * INT範囲外がNG
95
+ * @dataProvider provideParams
96
+ */
97
+ function testLaravelInteger ($ a , $ ex ) {
98
+ $ loader = new \Illuminate \Translation \ArrayLoader ();
99
+ $ translator = new \Illuminate \Translation \Translator ($ loader , 'ja ' );
100
+
101
+ $ inputs = ['a ' => $ a ];
102
+ $ rules = ['a ' => 'integer ' ];
103
+ $ validator = new \Illuminate \Validation \Validator ($ translator , $ inputs , $ rules );
104
+ $ this ->assertSame ($ ex , !$ validator ->fails (), "' $ a' " );
105
+ }
89
106
}
You can’t perform that action at this time.
0 commit comments