Skip to content

Commit 774dd0a

Browse files
authored
Merge branch 'master' into closure
2 parents a966cc9 + 56194b9 commit 774dd0a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

co-phpunit

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env php
22
<?php
3-
\Swoole\Coroutine::create(function () {
3+
4+
$code = 0;
5+
\Swoole\Coroutine::create(function () use (&$code) {
46
if (version_compare('7.1.0', PHP_VERSION, '>')) {
57
fwrite(
68
STDERR,
@@ -58,9 +60,8 @@
5860
require PHPUNIT_COMPOSER_INSTALL;
5961

6062
$code = PHPUnit\TextUI\Command::main(false);
61-
if ($code > 0) {
62-
exit($code);
63-
}
64-
65-
swoole_event_exit();
6663
});
64+
65+
swoole_event_wait();
66+
67+
exit($code);

0 commit comments

Comments
 (0)