File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-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 ;
13
+ use PHPUnit \Framework \TestCase ;
14
+
15
+ final class PhpunitNoticeTest extends TestCase
16
+ {
17
+ public function testOne (): void
18
+ {
19
+ Facade::emitter ()->testTriggeredPhpunitNotice (
20
+ $ this ->valueObjectForEvents (),
21
+ 'message ' ,
22
+ );
23
+
24
+ Facade::emitter ()->testRunnerTriggeredPhpunitNotice ('message ' );
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 runs code which triggers E_USER_WARNING
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/PhpunitNoticeTest.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 \PhpunitNoticeTest, 1 test)
22
+ Test Preparation Started (PHPUnit \TestFixture \Event \PhpunitNoticeTest::testOne)
23
+ Test Prepared (PHPUnit \TestFixture \Event \PhpunitNoticeTest::testOne)
24
+ Test Triggered PHPUnit Notice (PHPUnit \TestFixture \Event \PhpunitNoticeTest::testOne)
25
+ message
26
+ Test Runner Triggered Notice (message)
27
+ Test Passed (PHPUnit \TestFixture \Event \PhpunitNoticeTest::testOne)
28
+ Test Finished (PHPUnit \TestFixture \Event \PhpunitNoticeTest::testOne)
29
+ Test Suite Finished (PHPUnit \TestFixture \Event \PhpunitNoticeTest, 1 test)
30
+ Test Runner Execution Finished
31
+ Test Runner Finished
32
+ PHPUnit Finished (Shell Exit Code: 0 )
You can’t perform that action at this time.
0 commit comments