public static createForInvalidReferenceType ( string $reference ) : InvalidArgumentException | ||
$reference | string | |
return | InvalidArgumentException |
public static function createForInvalidReferenceType(string $reference) : \InvalidArgumentException
{
return new \InvalidArgumentException(sprintf('Expected reference to be either a string or a "%s" instance, got "%s" instead.', ValueInterface::class, $reference));
}
public function testTestCreateForInvalidReferenceType() { $exception = InvalidArgumentExceptionFactory::createForInvalidReferenceType('foo'); $this->assertEquals('Expected reference to be either a string or a "Nelmio\\Alice\\Definition\\ValueInterface" instance, got "foo"' . ' instead.', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }