Skip to content

Commit a6ae2e2

Browse files
Merge branch '11.5' into 12.1
2 parents 6ac6bc4 + 17ea7ca commit a6ae2e2

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

Diff for: tests/end-to-end/regression/6173.phpt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/6173
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = __DIR__ . '/6173/Issue6173Test.php';
8+
9+
require_once __DIR__ . '/../../bootstrap.php';
10+
11+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
12+
--EXPECTF--
13+
PHPUnit %s by Sebastian Bergmann and contributors.
14+
15+
Runtime: %s
16+
17+
hello, success!
18+
.hello, fail!
19+
F 2 / 2 (100%)
20+
21+
Time: %s, Memory: %s
22+
23+
There was 1 failure:
24+
25+
1) PHPUnit\TestFixture\Issue6173\Issue6173Test::test_log_fail
26+
Failed asserting that false is true.
27+
28+
%sIssue6173Test.php:%d
29+
30+
FAILURES!
31+
Tests: 2, Assertions: 2, Failures: 1.

Diff for: tests/end-to-end/regression/6173/Issue6173Test.php

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\TestFixture\Issue6173;
11+
12+
use function error_log;
13+
use PHPUnit\Framework\TestCase;
14+
15+
final class Issue6173Test extends TestCase
16+
{
17+
public function test_log_success(): void
18+
{
19+
error_log('hello, success!');
20+
$this->assertTrue(true);
21+
}
22+
23+
public function test_log_fail(): void
24+
{
25+
error_log('hello, fail!');
26+
$this->assertTrue(false);
27+
}
28+
}

0 commit comments

Comments
 (0)