public static createForInvalidExpressionLanguageTokenType ( string $type ) : InvalidArgumentException | ||
$type | string | |
return | InvalidArgumentException |
public function __construct(string $type) { if (false === array_key_exists($type, self::$values)) { throw InvalidArgumentExceptionFactory::createForInvalidExpressionLanguageTokenType($type); } $this->value = $type; }
public function testTestCreateForInvalidExpressionLanguageTokenType() { $exception = InvalidArgumentExceptionFactory::createForInvalidExpressionLanguageTokenType('foo'); $this->assertEquals('Expected type to be a known token type but got "foo".', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }