public static createForExpectedConfigurationPositiveIntegerValue ( integer $value ) : InvalidArgumentException | ||
$value | integer | |
Результат | 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()); }
private function createPositiveIntegerValidatorClosure() : \Closure { return function ($value) { if (is_int($value) && 0 < $value) { return $value; } throw InvalidArgumentExceptionFactory::createForExpectedConfigurationPositiveIntegerValue($value); }; }