public function test_expanders_that_takes_other_expanders_as_arguments() { $pattern = "@type@.expander(expander(\"test\"), expander(1))"; $expanders = $this->parser->getAST($pattern)->getExpanders(); $firstExpander = new Expander("expander"); $firstExpander->addArgument("test"); $secondExpander = new Expander("expander"); $secondExpander->addArgument(1); $this->assertEquals($expanders[0]->getArguments(), array($firstExpander, $secondExpander)); }
/** * @expectedException \Coduo\PHPMatcher\Exception\PatternException * @expectedExceptionMessage [Syntax Error] line 0, col 25: Error: Expected "string, number, boolean or null argument", got "not" */ public function test_not_argument_after_comma() { $this->parser->getAST("@type@.expander('string',not_argument"); }