/** * @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()); }
/** * @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)); }
/** * @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)); }