Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Aug 23, 2018
1 parent 0391874 commit e14b9ba
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/Util/TestDox/NamePrettifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,16 @@ public function prettifyTestCase(TestCase $test): string
$result = $annotations['method']['testdox'][0];

if (\strpos($result, '$') !== false) {
$annotation = $annotations['method']['testdox'][0];
$result = '';

$annotation = $annotations['method']['testdox'][0];
$providedData = $this->mapTestMethodParameterNamesToProvidedDataValues($test);

foreach (\explode(' ', $annotation) as $word) {
if (\strpos($word, '$') === 0) {
$result .= $providedData[$word] . ' ';
} else {
$result .= $word . ' ';
}
}

$result = \trim($result);
$result = trim(
str_replace(
array_keys($providedData),
$providedData,
$annotation
)
);

$annotationWithPlaceholders = true;
}
Expand Down

0 comments on commit e14b9ba

Please sign in to comment.