Skip to content

Commit 909b0fd

Browse files
staabmsebastianbergmann
authored andcommitted
Test runner deprecations can be ignored
1 parent df65cac commit 909b0fd

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/6329
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = '--display-phpunit-deprecations';
8+
$_SERVER['argv'][] = __DIR__ . '/6329/Issue6329Test.php';
9+
10+
require __DIR__ . '/../../bootstrap.php';
11+
12+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
13+
--EXPECTF--
14+
PHPUnit %s by Sebastian Bergmann and contributors.
15+
16+
Runtime: %s
17+
18+
. 1 / 1 (100%)
19+
20+
Time: %s, Memory: %s MB
21+
22+
OK (1 test, 1 assertion)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/*
5+
* This file is part of PHPUnit.
6+
*
7+
* (c) Sebastian Bergmann <[email protected]>
8+
*
9+
* For the full copyright and license information, please view the LICENSE
10+
* file that was distributed with this source code.
11+
*/
12+
13+
use PHPUnit\Event\Facade as EventFacade;
14+
use PHPUnit\Framework\Attributes\IgnorePhpunitDeprecations;
15+
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
16+
use PHPUnit\Framework\TestCase;
17+
18+
#[RunTestsInSeparateProcesses]
19+
final class Issue6329Test extends TestCase
20+
{
21+
#[IgnorePhpunitDeprecations]
22+
public function testOne(): void
23+
{
24+
EventFacade::emitter()->testRunnerTriggeredPhpunitDeprecation(
25+
'A runner deprecation!',
26+
);
27+
28+
$this->assertTrue(true);
29+
}
30+
}

0 commit comments

Comments
 (0)