Skip to content

Commit ecb3aed

Browse files
Merge branch '11.5'
2 parents e3c06ec + 2afa616 commit ecb3aed

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
Lines changed: 28 additions & 0 deletions
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 <[email protected]>
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\Event;
11+
12+
use PHPUnit\Event\Facade as EventFacade;
13+
use PHPUnit\Framework\Attributes\IgnorePhpunitDeprecations;
14+
use PHPUnit\Framework\TestCase;
15+
16+
final class IgnoredDeprecatedPhpunitFeatureTest extends TestCase
17+
{
18+
#[IgnorePhpunitDeprecations]
19+
public function testDeprecatedPhpunitFeature(): void
20+
{
21+
EventFacade::emitter()->testTriggeredPhpunitDeprecation(
22+
$this->valueObjectForEvents(),
23+
'message',
24+
);
25+
26+
$this->assertTrue(true);
27+
}
28+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
The right events are emitted in the right order for a test that uses a deprecated PHPUnit feature when PHPUnit deprecations are ignored using attribute
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = '--debug';
8+
$_SERVER['argv'][] = __DIR__ . '/_files/IgnoredDeprecatedPhpunitFeatureTest.php';
9+
10+
require __DIR__ . '/../../bootstrap.php';
11+
12+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
13+
--EXPECTF--
14+
PHPUnit Started (PHPUnit %s using %s)
15+
Test Runner Configured
16+
Event Facade Sealed
17+
Test Suite Loaded (1 test)
18+
Test Runner Started
19+
Test Suite Sorted
20+
Test Runner Execution Started (1 test)
21+
Test Suite Started (PHPUnit\TestFixture\Event\IgnoredDeprecatedPhpunitFeatureTest, 1 test)
22+
Test Preparation Started (PHPUnit\TestFixture\Event\IgnoredDeprecatedPhpunitFeatureTest::testDeprecatedPhpunitFeature)
23+
Test Prepared (PHPUnit\TestFixture\Event\IgnoredDeprecatedPhpunitFeatureTest::testDeprecatedPhpunitFeature)
24+
Test Passed (PHPUnit\TestFixture\Event\IgnoredDeprecatedPhpunitFeatureTest::testDeprecatedPhpunitFeature)
25+
Test Finished (PHPUnit\TestFixture\Event\IgnoredDeprecatedPhpunitFeatureTest::testDeprecatedPhpunitFeature)
26+
Test Suite Finished (PHPUnit\TestFixture\Event\IgnoredDeprecatedPhpunitFeatureTest, 1 test)
27+
Test Runner Execution Finished
28+
Test Runner Finished
29+
PHPUnit Finished (Shell Exit Code: 0)

0 commit comments

Comments
 (0)