Beispiel #1
0
 /**
  * @dataProvider getUnoptimizedData
  */
 public function testCompileWithoutOptimization($expression, $expectedDescription)
 {
     $lexer = new Lexer();
     $parser = new Parser(array());
     $compiler = new Compiler();
     $node = $parser->parse($lexer->tokenize($expression));
     $aDie = $compiler->compile($node);
     $this->assertEquals($expectedDescription, $aDie->getValueDescription());
 }
Beispiel #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));
 }
Beispiel #3
0
 /**
  * @dataProvider getParseData
  */
 public function testParse($node, $expression, $names = array())
 {
     $lexer = new Lexer();
     $parser = new Parser(array());
     $this->assertEquals($node, $parser->parse($lexer->tokenize($expression), $names));
 }