public static createForExpectedMethodCallOnlyIfHasAParser ( string $method ) : ParserNotFoundException | ||
$method | string | |
return | ParserNotFoundException |
public function testTestCreateForExpectedMethodCallOnlyIfHasAParser() { $exception = ExpressionLanguageExceptionFactory::createForExpectedMethodCallOnlyIfHasAParser('foo'); $this->assertEquals('Expected method "foo" to be called only if it has a parser.', $exception->getMessage()); $this->assertEquals(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); }
/** * @inheritdoc */ public function parse(Token $token) { if (null === $this->parser) { throw ExpressionLanguageExceptionFactory::createForExpectedMethodCallOnlyIfHasAParser(__METHOD__); } }