File tree Expand file tree Collapse file tree 3 files changed +39
-3
lines changed Expand file tree Collapse file tree 3 files changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -66,5 +66,5 @@ before_script:
6666 - php --ri swoole
6767
6868script :
69- - ./tests/run
69+ - composer test
7070
Original file line number Diff line number Diff line change 2323 }
2424 },
2525 "scripts" : {
26- "test" : " ./tests/run " ,
27- "install-test" : " php --ri swoole && composer install composer test"
26+ "test" : " ./vendor/bin/phpunit -c ./ tests/phpunit.xml " ,
27+ "install-test" : " php --ri swoole && composer install composer test"
2828 },
2929 "extra" : {
3030 "ide-helper" : {
Original file line number Diff line number Diff line change 11<?php
2+
3+ use Imi \App ;
4+ use Swoole \Event ;
5+ use Imi \Event \EventParam ;
26$ loader = require dirname (__DIR__ ) . '/vendor/autoload.php ' ;
37
48\Swoole \Runtime::enableCoroutine ();
9+
10+ ini_set ('date.timezone ' , date_default_timezone_get ());
11+
12+ App::initFramework ('ImiApp ' );
13+
14+ $ statusCode = 0 ;
15+ go (function () use (&$ statusCode ){
16+ go (function () use (&$ statusCode ){
17+ \Imi \Event \Event::on ('IMI.INIT_TOOL ' , function (EventParam $ param ){
18+ $ data = $ param ->getData ();
19+ $ data ['skip ' ] = true ;
20+ \Imi \Tool \Tool::init ();
21+ });
22+ \Imi \Event \Event::on ('IMI.INITED ' , function (EventParam $ param ){
23+ App::initWorker ();
24+ $ param ->stopPropagation ();
25+ }, 1 );
26+ App::run ('ImiApp ' );
27+ try {
28+ if ($ phpunitPath = getenv ('TEST_PHPUNIT_PATH ' ))
29+ {
30+ require $ phpunitPath ;
31+ }
32+ PHPUnit \TextUI \Command::main (false );
33+ } catch (\Swoole \ExitException $ e ) {
34+ $ statusCode = $ e ->getStatus ();
35+ }
36+ Event::exit ();
37+ });
38+ });
39+ Event::wait ();
40+ exit ($ statusCode );
You can’t perform that action at this time.
0 commit comments