parse($code); $this->assertEquals( $this->canonicalize($dump), $this->canonicalize($dumper->dump($stmts)), $name ); } public function provideTestParse() { return $this->getTests(__DIR__ . '/../code/parser', 'test'); } /** * @dataProvider provideTestParseFail */ public function testParseFail($name, $code, $msg) { $parser = new Parser(new Lexer\Emulative); try { $parser->parse($code); $this->fail(sprintf('"%s": Expected Error', $name)); } catch (Error $e) { $this->assertEquals($msg, $e->getMessage(), $name); } } public function provideTestParseFail() { return $this->getTests(__DIR__ . '/../code/parser', 'test-fail'); } }