Skip to content

Commit 5f0923f

Browse files
Fix snapshots
1 parent 50dc372 commit 5f0923f

4 files changed

+9
-68
lines changed

tests/OutputTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function testWithProfilingAtRunTime(): void
3636
{
3737
$command = [
3838
'vendor/bin/phpunit',
39+
'tests/ExampleTests/TestThatPassesTest.php',
3940
'--configuration=tests/phpunit.test.xml',
4041
'-d --profiling',
4142
];

tests/SnapshotTextDriver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ private function applyPregReplace(mixed $data): ?string
2424
'/FAILED(.*?)>(.*?)[ ]{3,}([\S]+)/' => 'FAILED$1>$2 $3',
2525
'/─[\S]*─/' => '───────────────────',
2626
'/([\d]+.[\d]+)%/' => 'SOME-PERCENTAGE',
27+
'/[ ]{3,}\(SOME-PERCENTAGE/' => '(SOME-PERCENTAGE',
2728
];
2829

2930
foreach ($regexes as $regex => $replacement) {
Lines changed: 6 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,13 @@
11

2-
FAIL Tests\ExampleTests\TestThatHasAllStatusesTest
3-
✓ success DURATION-IN-SECONDS
4-
⨯ fail DURATION-IN-SECONDS
5-
⨯ fail with diff DURATION-IN-SECONDS
6-
⨯ error DURATION-IN-SECONDS
7-
! risky → This test did not perform any assertions DURATION-IN-SECONDS
8-
- skip → skipped DURATION-IN-SECONDS
9-
… incomplete → incomplete DURATION-IN-SECONDS
10-
112
PASS Tests\ExampleTests\TestThatPassesTest
123
✓ do basic assertions DURATION-IN-SECONDS
134
✓ do some more assertions DURATION-IN-SECONDS
14-
───────────────────
15-
FAILED Tests\ExampleTests\TestThatHasAllStatusesTest > fail
16-
Failed asserting that false is true.
17-
18-
at tests/ExampleTests/TestThatHasAllStatusesTest.php:23
19-
19▕
20-
20▕ public function testFail(): void
21-
21▕ {
22-
22▕ usleep(self::SLEEP_IN_MICRO_SECONDS);
23-
➜ 23▕ $this->assertTrue(false);
24-
24▕ }
25-
25▕
26-
26▕ public function testFailWithDiff(): void
27-
27▕ {
28-
29-
1 tests/ExampleTests/TestThatHasAllStatusesTest.php:23
30-
31-
───────────────────
32-
FAILED Tests\ExampleTests\TestThatHasAllStatusesTest > fail with diff
33-
Failed asserting that two arrays are equal.
34-
Array (
35-
- 0 => 'one'
36-
- 1 => 'two'
37-
+ 0 => 'two'
38-
+ 1 => 'one'
39-
)
40-
415

42-
at tests/ExampleTests/TestThatHasAllStatusesTest.php:31
43-
27▕ {
44-
28▕ usleep(self::SLEEP_IN_MICRO_SECONDS);
45-
29▕ $this->assertEquals(
46-
30▕ ['one', 'two'],
47-
➜ 31▕ ['two', 'one']
48-
32▕ );
49-
33▕ }
50-
34▕
51-
35▕ public function testError(): void
52-
53-
1 tests/ExampleTests/TestThatHasAllStatusesTest.php:31
6+
Tests: 2 passed (4 assertions)
7+
Duration: DURATION-IN-SECONDS
548

9+
Top 10 slowest tests:
10+
Tests\ExampleTests\TestThatPassesTest > do basic assertions DURATION-IN-SECONDS
11+
Tests\ExampleTests\TestThatPassesTest > do some more assertions DURATION-IN-SECONDS
5512
───────────────────
56-
FAILED Tests\ExampleTests\TestThatHasAllStatusesTest > error Exception
57-
error
58-
59-
at tests/ExampleTests/TestThatHasAllStatusesTest.php:38
60-
34▕
61-
35▕ public function testError(): void
62-
36▕ {
63-
37▕ usleep(self::SLEEP_IN_MICRO_SECONDS);
64-
➜ 38▕ throw new \Exception('error');
65-
39▕ }
66-
40▕
67-
41▕ public function testRisky(): void
68-
42▕ {
69-
70-
1 tests/ExampleTests/TestThatHasAllStatusesTest.php:38
71-
72-
73-
Tests: 3 failed, 1 risky, 1 incomplete, 1 skipped, 3 passed (7 assertions)
74-
Duration: DURATION-IN-SECONDS
13+
(SOME-PERCENTAGE of DURATION-IN-SECONDS) DURATION-IN-SECONDS

tests/__snapshots__/OutputTest__testWithProfiling__1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
Tests\ExampleTests\TestThatPassesTest > do basic assertions DURATION-IN-SECONDS
1111
Tests\ExampleTests\TestThatPassesTest > do some more assertions DURATION-IN-SECONDS
1212
───────────────────
13-
(SOME-PERCENTAGE of DURATION-IN-SECONDS) DURATION-IN-SECONDS
13+
(SOME-PERCENTAGE of DURATION-IN-SECONDS) DURATION-IN-SECONDS

0 commit comments

Comments
 (0)