createForInvalidLimitValue() public static method

public static createForInvalidLimitValue ( integer $limit ) : InvalidArgumentException
$limit integer
return InvalidArgumentException
Exemplo n.º 1
0
 public function __construct(ValueResolverInterface $resolver = null, int $limit = 5)
 {
     $this->resolver = $resolver;
     if ($limit < 1) {
         throw InvalidArgumentExceptionFactory::createForInvalidLimitValue($limit);
     }
     $this->limit = $limit;
 }
Exemplo n.º 2
0
 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());
 }