Skip to content

Commit 64bda38

Browse files
staabmsebastianbergmann
authored andcommitted
Test runner deprecation from subprocess
1 parent e437714 commit 64bda38

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

tests/end-to-end/regression/6329.phpt renamed to tests/end-to-end/regression/6329-runner-deprecation-ignored.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ https://github.com/sebastianbergmann/phpunit/issues/6329
55
$_SERVER['argv'][] = '--do-not-cache-result';
66
$_SERVER['argv'][] = '--no-configuration';
77
$_SERVER['argv'][] = '--display-phpunit-deprecations';
8-
$_SERVER['argv'][] = __DIR__ . '/6329/Issue6329Test.php';
8+
$_SERVER['argv'][] = __DIR__ . '/6329/Issue6329DeprecationIgnoredTest.php';
99

1010
require __DIR__ . '/../../bootstrap.php';
1111

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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/Issue6329DeprecationTest.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+
There was 1 PHPUnit test runner deprecation:
23+
24+
1) A runner deprecation!
25+
26+
OK, but there were issues!
27+
Tests: 1, Assertions: 1, PHPUnit Deprecations: 1.

tests/end-to-end/regression/6329/Issue6329Test.php renamed to tests/end-to-end/regression/6329/Issue6329DeprecationIgnoredTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use PHPUnit\Framework\TestCase;
1616

1717
#[RunTestsInSeparateProcesses]
18-
final class Issue6329Test extends TestCase
18+
final class Issue6329DeprecationIgnoredTest extends TestCase
1919
{
2020
#[IgnorePhpunitDeprecations]
2121
public function testOne(): void
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
use PHPUnit\Event\Facade as EventFacade;
13+
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
14+
use PHPUnit\Framework\TestCase;
15+
16+
#[RunTestsInSeparateProcesses]
17+
final class Issue6329DeprecationTest extends TestCase
18+
{
19+
public function testOne(): void
20+
{
21+
EventFacade::emitter()->testRunnerTriggeredPhpunitDeprecation(
22+
'A runner deprecation!',
23+
);
24+
25+
$this->assertTrue(true);
26+
}
27+
}

0 commit comments

Comments
 (0)