/** * @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 getInvalidPostfixData * @expectedException \Profideo\Component\ExpressionLanguage\SyntaxError */ public function testParseWithInvalidPostfixData($expr, $names = array()) { $lexer = new Lexer(); $parser = new Parser(array()); $parser->parse($lexer->tokenize($expr), $names); }