Skip to content

Commit 1d80b6f

Browse files
lyrixxsebastianbergmann
authored andcommitted
Fix tests
1 parent 7aa7b77 commit 1d80b6f

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/Runner/ShutdownHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static function (): void
5252
return;
5353
}
5454

55-
print self::$message . PHP_EOL;
55+
print $message . PHP_EOL;
5656
},
5757
);
5858
}

tests/end-to-end/cli/shutdown-handler-with-message.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@ $_SERVER['argv'][] = __DIR__ . '/../_files/WithExitTest.php';
1010

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

13+
// Destructs are called after register_shutdown_function callback
14+
$x = new class ()
15+
{
16+
function __destruct()
17+
{
18+
print '----';
19+
}
20+
};
21+
1322
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
1423
--EXPECTF--
1524
PHPUnit %s by Sebastian Bergmann and contributors.
1625

1726
Runtime: %s
1827

1928
messageFatal error: Premature end of PHP process when running PHPUnit\TestFixture\WithExitTest::testWithMessage.
29+
----

tests/end-to-end/cli/shutdown-handler-without-message.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@ $_SERVER['argv'][] = __DIR__ . '/../_files/WithExitTest.php';
1010

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

13+
// Destructs are called after register_shutdown_function callback
14+
$x = new class ()
15+
{
16+
function __destruct()
17+
{
18+
print '----';
19+
}
20+
};
21+
1322
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
1423
--EXPECTF--
1524
PHPUnit %s by Sebastian Bergmann and contributors.
1625

1726
Runtime: %s
1827

1928
Fatal error: Premature end of PHP process when running PHPUnit\TestFixture\WithExitTest::testWithoutMessage.
29+
----

0 commit comments

Comments
 (0)