File tree 2 files changed +57
-0
lines changed
2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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 )
You can’t perform that action at this time.
0 commit comments