File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 ],
1313 "require" : {
1414 "php" : " >=5.3" ,
15- "evenement/evenement" : " ~1.0|~2 .0" ,
16- "react/promise " : " ~ 1.0|~2.0 " ,
17- "react/socket " : " ^0.7 " ,
18- "react/event-loop " : " 0.3.*|0.4.* "
15+ "evenement/evenement" : " ^3.0 || ^2.0 || ^1 .0" ,
16+ "react/event-loop " : " ^ 1.0 || ^0.5 || ^0.4 || ^0.3 " ,
17+ "react/promise " : " ^2.0 || ^1.0 " ,
18+ "react/socket " : " ^1.0 || ^0.8 || ^0.7 "
1919 },
2020 "require-dev" : {
21+ "clue/block-react" : " ^1.2" ,
2122 "phpunit/phpunit" : " ^5.0 || ^4.8"
2223 },
2324 "autoload" : {
Original file line number Diff line number Diff line change 11<?php
22
33use Clue \React \Ami \Factory ;
4- use React \Promise \PromiseInterface ;
54use Clue \React \Ami \Client ;
65use Clue \React \Ami \ActionSender ;
7- use Clue \React \Ami \Protocol \Response ;
6+ use Clue \React \Block ;
7+ use React \Promise \PromiseInterface ;
88
99class FunctionalTest extends TestCase
1010{
@@ -90,23 +90,6 @@ public function testSendRejectedAfterClose(Client $client)
9090
9191 private function waitFor (PromiseInterface $ promise )
9292 {
93- $ resolved = null ;
94- $ exception = null ;
95-
96- $ promise ->then (function ($ c ) use (&$ resolved ) {
97- $ resolved = $ c ;
98- }, function ($ error ) use (&$ exception ) {
99- $ exception = $ error ;
100- });
101-
102- while ($ resolved === null && $ exception === null ) {
103- self ::$ loop ->tick ();
104- }
105-
106- if ($ exception !== null ) {
107- throw $ exception ;
108- }
109-
110- return $ resolved ;
93+ return Block \await ($ promise , self ::$ loop , 5.0 );
11194 }
11295}
You can’t perform that action at this time.
0 commit comments