Skip to content

Commit 77dc808

Browse files
Use JUnit XML logfile as expectation instead of test runner output
1 parent c722fb2 commit 77dc808

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

tests/end-to-end/regression/5771.phpt

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,21 @@ https://github.com/sebastianbergmann/phpunit/issues/5771
33
--FILE--
44
<?php declare(strict_types=1);
55
$_SERVER['argv'][] = '--no-configuration';
6+
$_SERVER['argv'][] = '--no-output';
67
$_SERVER['argv'][] = __DIR__ . '/5771/Issue5771Test.php';
78
$_SERVER['argv'][] = '--log-junit';
8-
$_SERVER['argv'][] = tempnam(sys_get_temp_dir(), __FILE__);
9+
$_SERVER['argv'][] = 'php://stdout';
910

1011
require_once __DIR__ . '/../../bootstrap.php';
1112

1213
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
1314
--EXPECTF--
14-
PHPUnit %s by Sebastian Bergmann and contributors.
15-
16-
Runtime: %s
17-
18-
E 1 / 1 (100%)
19-
20-
Time: %s, Memory: %s
21-
22-
There was 1 error:
23-
24-
1) PHPUnit\TestFixture\Issue5771\Issue5771Test::test
25-
Test was run in child process and ended unexpectedly
26-
27-
ERRORS!
28-
Tests: 1, Assertions: 0, Errors: 1.
15+
<?xml version="1.0" encoding="UTF-8"?>
16+
<testsuites>
17+
<testsuite name="PHPUnit\TestFixture\Issue5771\Issue5771Test" file="%sIssue5771Test.php" tests="1" assertions="0" errors="1" failures="0" skipped="0" time="%s">
18+
<testcase name="testOne" file="%sIssue5771Test.php" line="18" class="PHPUnit\TestFixture\Issue5771\Issue5771Test" classname="PHPUnit.TestFixture.Issue5771.Issue5771Test" assertions="0" time="%s">
19+
<error type="PHPUnit\Framework\AssertionFailedError">PHPUnit\TestFixture\Issue5771\Issue5771Test::testOne
20+
Test was run in child process and ended unexpectedly</error>
21+
</testcase>
22+
</testsuite>
23+
</testsuites>

tests/end-to-end/regression/5771/Issue5771Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
final class Issue5771Test extends TestCase
1616
{
1717
#[RunInSeparateProcess]
18-
public function test(): void
18+
public function testOne(): void
1919
{
2020
exit;
2121
}

0 commit comments

Comments
 (0)