示例#1
0
 /**
  * @dataProvider getInvalidPostfixData
  * @expectedException \Hydra\Component\ExpressionLanguage\SyntaxError
  */
 public function testParseWithInvalidPostfixData($expr, $names = array())
 {
     $lexer = new Lexer();
     $parser = new Parser(array());
     $parser->parse($lexer->tokenize($expr), $names);
 }
示例#2
0
 /**
  * @dataProvider getTokenizeData
  */
 public function testTokenize($tokens, $expression)
 {
     $tokens[] = new Token('end of expression', null, strlen($expression) + 1);
     $lexer = new Lexer();
     $this->assertEquals(new TokenStream($tokens), $lexer->tokenize($expression));
 }