diff --git a/tests/Integration/Types/IntegerTypeTest.php b/tests/Integration/Types/IntegerTypeTest.php index 02b6f5d..f67dade 100644 --- a/tests/Integration/Types/IntegerTypeTest.php +++ b/tests/Integration/Types/IntegerTypeTest.php @@ -12,7 +12,7 @@ public function testNonStringValue() { $this->assertIntegerValidation( 42, 42 ); } - private function assertIntegerValidation( int $expected, $input, array $definitionExtras = [] ) { + private function assertIntegerValidation( $expected, $input, array $definitionExtras = [] ) { $parameters = $this->process( [ 'amount' => array_merge( @@ -35,4 +35,16 @@ public function testNonStringValueDefaultsWhenExceedingUpperBound() { $this->assertIntegerValidation( 7, 42, [ 'upperbound' => 20, 'default' => 7 ] ); } + public function testNonStringDefault() { + $this->assertIntegerValidation( '7', 'NAN', [ 'default' => '7' ] ); + } + + public function testNoNegatives() { + $this->assertIntegerValidation( 7, -1, [ 'negatives' => false, 'default' => 7 ] ); + } + + public function testNegative() { + $this->assertIntegerValidation( -1, -1 ); + } + }