createForExpectedConfigurationPositiveIntegerValue() public static method

public static createForExpectedConfigurationPositiveIntegerValue ( integer $value ) : InvalidArgumentException
$value integer
return InvalidArgumentException
 public function testTestCreateForExpectedConfigurationPositiveIntegerValue()
 {
     $exception = InvalidArgumentExceptionFactory::createForExpectedConfigurationPositiveIntegerValue(-1);
     $this->assertEquals('Expected a strictly positive integer but got "-1" instead.', $exception->getMessage());
     $this->assertEquals(0, $exception->getCode());
     $this->assertNull($exception->getPrevious());
 }
Beispiel #2
0
 private function createPositiveIntegerValidatorClosure() : \Closure
 {
     return function ($value) {
         if (is_int($value) && 0 < $value) {
             return $value;
         }
         throw InvalidArgumentExceptionFactory::createForExpectedConfigurationPositiveIntegerValue($value);
     };
 }