public static createForInvalidLimitValueForRecursiveCalls ( integer $limit ) : InvalidArgumentException | ||
$limit | integer | |
return | InvalidArgumentException |
public function __construct(ChainableParameterResolverInterface $resolver, int $limit = 5) { $this->resolver = $resolver; if (2 >= $limit) { throw InvalidArgumentExceptionFactory::createForInvalidLimitValueForRecursiveCalls($limit); } $this->limit = $limit; }
public function testTestCreateForInvalidLimitValueForRecursiveCalls() { $exception = InvalidArgumentExceptionFactory::createForInvalidLimitValueForRecursiveCalls(10); $this->assertEquals('Expected limit for recursive calls to be of at least 2. Got "10" instead.', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }