mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +01:00
Don't distinguish test-fail / test
With error recovery this is fluid. Using .test for everything.
This commit is contained in:
parent
3b7d8e8b5d
commit
0731b47655
@ -11,26 +11,7 @@ class ParserTest extends CodeTestAbstract
|
||||
/**
|
||||
* @dataProvider provideTestParse
|
||||
*/
|
||||
public function testParse($name, $code, $dump) {
|
||||
$parser = new Parser(new Lexer\Emulative);
|
||||
$dumper = new NodeDumper;
|
||||
|
||||
$stmts = $parser->parse($code);
|
||||
$this->assertSame(
|
||||
$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, $expected) {
|
||||
public function testParse($name, $code, $expected) {
|
||||
$lexer = new Lexer\Emulative(array('usedAttributes' => array(
|
||||
'startLine', 'endLine', 'startFilePos', 'endFilePos'
|
||||
)));
|
||||
@ -54,6 +35,10 @@ class ParserTest extends CodeTestAbstract
|
||||
$this->assertSame($this->canonicalize($expected), $this->canonicalize($output), $name);
|
||||
}
|
||||
|
||||
public function provideTestParse() {
|
||||
return $this->getTests(__DIR__ . '/../code/parser', 'test');
|
||||
}
|
||||
|
||||
private function formatErrorMessage(Error $e, $code) {
|
||||
if ($e->hasColumnInfo()) {
|
||||
return $e->getRawMessage() . ' from ' . $e->getStartLine() . ':' . $e->getStartColumn($code)
|
||||
@ -63,10 +48,6 @@ class ParserTest extends CodeTestAbstract
|
||||
}
|
||||
}
|
||||
|
||||
public function provideTestParseFail() {
|
||||
return $this->getTests(__DIR__ . '/../code/parser', 'test-fail');
|
||||
}
|
||||
|
||||
public function testAttributeAssignment() {
|
||||
$lexer = new Lexer(array(
|
||||
'usedAttributes' => array(
|
||||
|
Loading…
Reference in New Issue
Block a user