File tree Expand file tree Collapse file tree 4 files changed +39
-28
lines changed Expand file tree Collapse file tree 4 files changed +39
-28
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,13 @@ final class WithExitTest extends TestCase
1616 public function testWithMessage (): void
1717 {
1818 $ this ->assertTrue (true );
19- $ this ->assertTrue (true );
2019
21- exit ('My Custom Exit Message ' );
20+ exit ('message ' );
2221 }
2322
2423 public function testWithoutMessage (): void
2524 {
2625 $ this ->assertTrue (true );
27- $ this ->assertTrue (true );
2826
2927 exit (1 );
3028 }
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Shutdown Handler: exit(1)
3+ --FILE--
4+ <?php declare (strict_types=1 );
5+ $ _SERVER ['argv ' ][] = '--do-not-cache-result ' ;
6+ $ _SERVER ['argv ' ][] = '--no-configuration ' ;
7+ $ _SERVER ['argv ' ][] = '--filter ' ;
8+ $ _SERVER ['argv ' ][] = 'testWithMessage ' ;
9+ $ _SERVER ['argv ' ][] = __DIR__ . '/../_files/WithExitTest.php ' ;
10+
11+ require __DIR__ . '/../../bootstrap.php ' ;
12+
13+ (new PHPUnit \TextUI \Application )->run ($ _SERVER ['argv ' ]);
14+ --EXPECTF --
15+ PHPUnit %s by Sebastian Bergmann and contributors.
16+
17+ Runtime: %s
18+
19+ messageFatal error: Premature end of PHP process when running PHPUnit \TestFixture \WithExitTest::testWithMessage.
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Shutdown Handler: exit('message')
3+ --FILE--
4+ <?php declare (strict_types=1 );
5+ $ _SERVER ['argv ' ][] = '--do-not-cache-result ' ;
6+ $ _SERVER ['argv ' ][] = '--no-configuration ' ;
7+ $ _SERVER ['argv ' ][] = '--filter ' ;
8+ $ _SERVER ['argv ' ][] = 'testWithoutMessage ' ;
9+ $ _SERVER ['argv ' ][] = __DIR__ . '/../_files/WithExitTest.php ' ;
10+
11+ require __DIR__ . '/../../bootstrap.php ' ;
12+
13+ (new PHPUnit \TextUI \Application )->run ($ _SERVER ['argv ' ]);
14+ --EXPECTF --
15+ PHPUnit %s by Sebastian Bergmann and contributors.
16+
17+ Runtime: %s
18+
19+ Fatal error: Premature end of PHP process when running PHPUnit \TestFixture \WithExitTest::testWithoutMessage.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments