createForInvalidExpressionLanguageTokenType() 공개 정적인 메소드

public static createForInvalidExpressionLanguageTokenType ( string $type ) : InvalidArgumentException
$type string
리턴 InvalidArgumentException
예제 #1
0
파일: TokenType.php 프로젝트: nelmio/alice
 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());
 }