Skip to content

Commit 5dc47b3

Browse files
authored
Add --testdox-summary support (#1032)
1 parent 845c1a6 commit 5dc47b3

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

src/Options.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,12 @@ public static function setInputDefinition(InputDefinition $inputDefinition): voi
558558
InputOption::VALUE_NONE,
559559
'@see PHPUnit guide, chapter: ' . $chapter,
560560
),
561+
new InputOption(
562+
'testdox-summary',
563+
null,
564+
InputOption::VALUE_NONE,
565+
'@see PHPUnit guide, chapter: ' . $chapter,
566+
),
561567
new InputOption(
562568
'log-junit',
563569
null,

test/Unit/WrapperRunner/WrapperRunnerTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,28 @@ public function testTestdoxOutput(): void
281281
);
282282
}
283283

284+
public function testTestdoxOutputWithSummary(): void
285+
{
286+
$this->bareOptions['path'] = $this->fixture('common_results');
287+
$this->bareOptions['--testdox'] = true;
288+
$this->bareOptions['--testdox-summary'] = true;
289+
290+
$result = $this->runRunner();
291+
292+
$format = file_get_contents(__DIR__ . '/fixtures/common_results_testdox_with_summary_output');
293+
self::assertNotFalse($format);
294+
295+
$output = $result->output;
296+
$output = preg_replace("/^Processes: \\d+\nRuntime: PHP \\d+\\.\\d+\\.\\w+(-.+)?\n\n/", '', $output, 1, $count);
297+
self::assertSame(1, $count);
298+
self::assertNotNull($output);
299+
300+
self::assertStringMatchesFormat(
301+
$format,
302+
$output,
303+
);
304+
}
305+
284306
public function testTestdoxTextLog(): void
285307
{
286308
$outputPath = $this->tmpDir . DIRECTORY_SEPARATOR . 'testdox-output.text';
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
EFIRS.W 7 / 7 (100%)
2+
3+
Time: %s, Memory: %s MB
4+
5+
Error (ParaTest\Tests\fixtures\common_results\Error)
6+
✘ Error
7+
8+
│ RuntimeException: Error here!
9+
10+
│ %s/test/fixtures/common_results/ErrorTest.php:15
11+
12+
13+
Failure (ParaTest\Tests\fixtures\common_results\Failure)
14+
✘ Failure
15+
16+
│ Failed asserting that false is true.
17+
18+
│ %s/test/fixtures/common_results/FailureTest.php:14
19+
20+
21+
Incomplete (ParaTest\Tests\fixtures\common_results\Incomplete)
22+
∅ Incomplete
23+
24+
25+
│ %s/test/fixtures/common_results/IncompleteTest.php:14
26+
27+
28+
Risky (ParaTest\Tests\fixtures\common_results\Risky)
29+
⚠ Risky
30+
31+
Skipped (ParaTest\Tests\fixtures\common_results\Skipped)
32+
↩ Skipped
33+
34+
Success (ParaTest\Tests\fixtures\common_results\Success)
35+
✔ Success
36+
37+
Warning (ParaTest\Tests\fixtures\common_results\Warning)
38+
⚠ Warning
39+
40+
Summary of tests with errors, failures, or issues:
41+
42+
Error (ParaTest\Tests\fixtures\common_results\Error)
43+
✘ Error
44+
45+
│ RuntimeException: Error here!
46+
47+
│ %s/test/fixtures/common_results/ErrorTest.php:15
48+
49+
50+
Failure (ParaTest\Tests\fixtures\common_results\Failure)
51+
✘ Failure
52+
53+
│ Failed asserting that false is true.
54+
55+
│ %s/test/fixtures/common_results/FailureTest.php:14
56+
57+
58+
Incomplete (ParaTest\Tests\fixtures\common_results\Incomplete)
59+
∅ Incomplete
60+
61+
62+
│ %s/test/fixtures/common_results/IncompleteTest.php:14
63+
64+
65+
Risky (ParaTest\Tests\fixtures\common_results\Risky)
66+
⚠ Risky
67+
68+
Skipped (ParaTest\Tests\fixtures\common_results\Skipped)
69+
↩ Skipped
70+
71+
Warning (ParaTest\Tests\fixtures\common_results\Warning)
72+
⚠ Warning
73+
74+
ERRORS!
75+
Tests: %s

0 commit comments

Comments
 (0)