Skip to content

Commit

Permalink
Merge pull request #3 from swisnl/feature-correct-parser-class
Browse files Browse the repository at this point in the history
Show correct parser class for JavaScript tests
  • Loading branch information
bbrala authored Feb 5, 2018
2 parents 681bfde + 09f22ec commit 8f69007
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Parsers/Behat.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function run(Repository $repository, Result\ValidationInterface $validati
$line->getCommit()->getAuthorName(),
$line->getCommit()->getAuthorEmail(),
$line->getCommit()->getCommitterDate()->getTimestamp(),
self::class
static::class
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Parsers/Codeception/Cept.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function run(Repository $repository, Result\ValidationInterface $validati
$line->getCommit()->getAuthorName(),
$line->getCommit()->getAuthorEmail(),
$line->getCommit()->getCommitterDate()->getTimestamp(),
self::class
static::class
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Parsers/Codeception/Cest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function run(Repository $repository, Result\ValidationInterface $validati
$line->getCommit()->getAuthorName(),
$line->getCommit()->getAuthorEmail(),
$line->getCommit()->getCommitterDate()->getTimestamp(),
self::class
static::class
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Parsers/JavaScript/BaseJavaScriptParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function run(Repository $repository, Result\ValidationInterface $validati
$line->getCommit()->getAuthorName(),
$line->getCommit()->getAuthorEmail(),
$line->getCommit()->getCommitterDate()->getTimestamp(),
self::class
static::class
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Parsers/PhpUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function run(Repository $repository, Result\ValidationInterface $validati
$line->getCommit()->getAuthorName(),
$line->getCommit()->getAuthorEmail(),
$line->getCommit()->getCommitterDate()->getTimestamp(),
self::class
static::class
);
}
}
Expand Down
5 changes: 5 additions & 0 deletions tests/Parsers/BaseParserTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ protected function setUp()
* @param ParserInterface $parser
* @param array $expectedFiles What files do we expect as result
* @param int $expectedCount How many tests should be counted
* @return Result[]
*/
protected function runParserTest($parser, $expectedFiles, $expectedCount)
{
Expand All @@ -33,6 +34,8 @@ protected function runParserTest($parser, $expectedFiles, $expectedCount)
foreach ($results as $result) {
static::assertInstanceOf(Result::class, $result);

static::assertEquals(get_class($parser), $result->getParser());

if (in_array($result->getFilename(), $expectedFiles)) {
$count++;
}
Expand All @@ -42,5 +45,7 @@ protected function runParserTest($parser, $expectedFiles, $expectedCount)
$count,
'Check if file list has ' . $expectedCount . ' results.'
);

return $results;
}
}

0 comments on commit 8f69007

Please sign in to comment.