Skip to content

Commit

Permalink
Add Mutator information to GitHub annotation logger
Browse files Browse the repository at this point in the history
* It will give more information about what Mutator is used and will be in line with other loggers
* It will make it clear to understand why the diff can be empty, like in #1524

Fixes #1524
  • Loading branch information
maks-rafalko committed Jul 21, 2021
1 parent 8c97e07 commit 896ca5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Logger/GitHubAnnotationsLogger.php
Expand Up @@ -63,7 +63,7 @@ public function getLogLines(): array
$error = [
'line' => $escapedExecutionResult->getOriginalStartingLine(),
'message' => <<<"TEXT"
Escaped Mutant:
Escaped Mutant for Mutator "{$escapedExecutionResult->getMutatorName()}":
{$escapedExecutionResult->getMutantDiff()}
TEXT
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/Logger/GitHubAnnotationsLoggerTest.php
Expand Up @@ -68,8 +68,8 @@ public function metricsProvider(): iterable
yield 'all mutations' => [
$this->createCompleteResultsCollector(),
[
"::warning file=foo/bar,line=9::Escaped Mutant:%0A%0A--- Original%0A+++ New%0A@@ @@%0A%0A- echo 'original';%0A+ echo 'escaped#1';%0A\n",
"::warning file=foo/bar,line=10::Escaped Mutant:%0A%0A--- Original%0A+++ New%0A@@ @@%0A%0A- echo 'original';%0A+ echo 'escaped#0';%0A\n",
"::warning file=foo/bar,line=9::Escaped Mutant for Mutator \"PregQuote\":%0A%0A--- Original%0A+++ New%0A@@ @@%0A%0A- echo 'original';%0A+ echo 'escaped#1';%0A\n",
"::warning file=foo/bar,line=10::Escaped Mutant for Mutator \"For_\":%0A%0A--- Original%0A+++ New%0A@@ @@%0A%0A- echo 'original';%0A+ echo 'escaped#0';%0A\n",
],
];
}
Expand Down

0 comments on commit 896ca5a

Please sign in to comment.