Skip to content

Commit c435c47

Browse files
carusogabrielfelixfbecker
authored andcommitted
Refactoring tests (#217)
1 parent 10e901a commit c435c47

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/ParserGrammarTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function testSpecOutputTreeClassificationAndLength($testCaseFile, $expect
100100
$tokens = str_replace("\r\n", "\n", json_encode($sourceFile, JSON_PRETTY_PRINT));
101101
file_put_contents($expectedTreeFile, $tokens);
102102

103-
$this->assertEquals(0, count(DiagnosticsProvider::getDiagnostics($sourceFile)));
103+
$this->assertCount(0, DiagnosticsProvider::getDiagnostics($sourceFile));
104104
}
105105

106106
public function outTreeProvider() {

tests/api/getResolvedName.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function dataProvider() {
8282
*/
8383
public function testGetResolvedName($contents, $expectedName) {
8484
$node = $this->getNodeAtPosition($contents);
85-
$this->assertTrue($node instanceof Node\QualifiedName, "Node is not QualifiedName: " . get_class($node));
85+
$this->assertInstanceOf(Node\QualifiedName::class, $node);
8686

8787
$name = $node->getResolvedName();
8888
$this->assertEquals($expectedName, (string)$name);
@@ -91,7 +91,7 @@ public function testGetResolvedName($contents, $expectedName) {
9191
private function getNodeAtPosition($contents): Node {
9292
$parser = new Parser();
9393
$pos = strpos($contents, '_');
94-
$this->assertTrue($pos != FALSE, 'Data is missing underscore');
94+
$this->assertNotFalse($pos, 'Data is missing underscore');
9595
$contents = str_replace('_', '', $contents);
9696

9797
$node = $parser->parseSourceFile($contents);

0 commit comments

Comments
 (0)