Skip to content

Commit

Permalink
Improve variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 7, 2019
1 parent 96fc9b1 commit 2aa84b3
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/Util/TestDox/XmlResultPrinter.php
Expand Up @@ -161,34 +161,34 @@ function ($group) {
}
);

$node = $this->document->createElement('test');
$testNode = $this->document->createElement('test');

$node->setAttribute('className', \get_class($test));
$node->setAttribute('methodName', $test->getName());
$node->setAttribute('prettifiedClassName', $this->prettifier->prettifyTestClass(\get_class($test)));
$node->setAttribute('prettifiedMethodName', $this->prettifier->prettifyTestCase($test));
$node->setAttribute('status', (string) $test->getStatus());
$node->setAttribute('time', (string) $time);
$node->setAttribute('size', (string) $test->getSize());
$node->setAttribute('groups', \implode(',', $groups));
$testNode->setAttribute('className', \get_class($test));
$testNode->setAttribute('methodName', $test->getName());
$testNode->setAttribute('prettifiedClassName', $this->prettifier->prettifyTestClass(\get_class($test)));
$testNode->setAttribute('prettifiedMethodName', $this->prettifier->prettifyTestCase($test));
$testNode->setAttribute('status', (string) $test->getStatus());
$testNode->setAttribute('time', (string) $time);
$testNode->setAttribute('size', (string) $test->getSize());
$testNode->setAttribute('groups', \implode(',', $groups));

foreach ($groups as $group) {
$groupNode = $this->document->createElement('group');

$groupNode->setAttribute('name', $group);

$node->appendChild($groupNode);
$testNode->appendChild($groupNode);
}

$inlineAnnotations = \PHPUnit\Util\Test::getInlineAnnotations(\get_class($test), $test->getName());

if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) {
$node->setAttribute('given', $inlineAnnotations['given']['value']);
$node->setAttribute('givenStartLine', $inlineAnnotations['given']['line']);
$node->setAttribute('when', $inlineAnnotations['when']['value']);
$node->setAttribute('whenStartLine', $inlineAnnotations['when']['line']);
$node->setAttribute('then', $inlineAnnotations['then']['value']);
$node->setAttribute('thenStartLine', $inlineAnnotations['then']['line']);
$testNode->setAttribute('given', $inlineAnnotations['given']['value']);
$testNode->setAttribute('givenStartLine', $inlineAnnotations['given']['line']);
$testNode->setAttribute('when', $inlineAnnotations['when']['value']);
$testNode->setAttribute('whenStartLine', $inlineAnnotations['when']['line']);
$testNode->setAttribute('then', $inlineAnnotations['then']['value']);
$testNode->setAttribute('thenStartLine', $inlineAnnotations['then']['line']);
}

if ($this->exception !== null) {
Expand All @@ -203,15 +203,15 @@ function ($group) {

foreach ($steps as $step) {
if (isset($step['file']) && $step['file'] === $file) {
$node->setAttribute('exceptionLine', (string) $step['line']);
$testNode->setAttribute('exceptionLine', (string) $step['line']);

break;
}
}

$node->setAttribute('exceptionMessage', $this->exception->getMessage());
$testNode->setAttribute('exceptionMessage', $this->exception->getMessage());
}

$this->root->appendChild($node);
$this->root->appendChild($testNode);
}
}

0 comments on commit 2aa84b3

Please sign in to comment.