public static createForInvalidLimitValue ( integer $limit ) : InvalidArgumentException | ||
$limit | integer | |
return | InvalidArgumentException |
public function __construct(ValueResolverInterface $resolver = null, int $limit = 5) { $this->resolver = $resolver; if ($limit < 1) { throw InvalidArgumentExceptionFactory::createForInvalidLimitValue($limit); } $this->limit = $limit; }
public function __construct(UniqueValuesPool $pool, ValueResolverInterface $resolver = null, int $limit = 150) { $this->pool = $pool; $this->resolver = $resolver; if ($limit < 1) { throw InvalidArgumentExceptionFactory::createForInvalidLimitValue($limit); } $this->limit = $limit; }
public function testTestCreateForInvalidLimitValue() { $exception = InvalidArgumentExceptionFactory::createForInvalidLimitValue(10); $this->assertEquals('Expected limit value to be a strictly positive integer, got "10" instead.', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }