6
6
use React \EventLoop \StreamSelectLoop ;
7
7
use React \Promise \Deferred ;
8
8
use React \Promise \PromiseInterface ;
9
- use function Clue \React \Block \await ;
10
9
11
10
class FunctionalTest extends TestCase
12
11
{
@@ -33,7 +32,7 @@ public function testPing()
33
32
$ promise = $ redis ->ping ();
34
33
$ this ->assertInstanceOf (PromiseInterface::class, $ promise );
35
34
36
- $ ret = await ($ promise, $ this -> loop );
35
+ $ ret = \ React \ Async \ await ($ promise );
37
36
38
37
$ this ->assertEquals ('PONG ' , $ ret );
39
38
}
@@ -45,7 +44,7 @@ public function testPingLazy()
45
44
$ promise = $ redis ->ping ();
46
45
$ this ->assertInstanceOf (PromiseInterface::class, $ promise );
47
46
48
- $ ret = await ($ promise, $ this -> loop );
47
+ $ ret = \ React \ Async \ await ($ promise );
49
48
50
49
$ this ->assertEquals ('PONG ' , $ ret );
51
50
}
@@ -83,7 +82,7 @@ public function testMgetIsNotInterpretedAsSubMessage()
83
82
$ promise = $ redis ->mget ('message ' , 'channel ' , 'payload ' )->then ($ this ->expectCallableOnce ());
84
83
$ redis ->on ('message ' , $ this ->expectCallableNever ());
85
84
86
- await ($ promise, $ this -> loop );
85
+ \ React \ Async \ await ($ promise );
87
86
}
88
87
89
88
public function testPipeline ()
@@ -95,7 +94,7 @@ public function testPipeline()
95
94
$ redis ->incr ('a ' )->then ($ this ->expectCallableOnceWith (3 ));
96
95
$ promise = $ redis ->get ('a ' )->then ($ this ->expectCallableOnceWith ('3 ' ));
97
96
98
- await ($ promise, $ this -> loop );
97
+ \ React \ Async \ await ($ promise );
99
98
}
100
99
101
100
public function testInvalidCommand ()
@@ -108,7 +107,7 @@ public function testInvalidCommand()
108
107
} else {
109
108
$ this ->setExpectedException ('Exception ' );
110
109
}
111
- await ($ promise, $ this -> loop );
110
+ \ React \ Async \ await ($ promise );
112
111
}
113
112
114
113
public function testMultiExecEmpty ()
@@ -117,7 +116,7 @@ public function testMultiExecEmpty()
117
116
$ redis ->multi ()->then ($ this ->expectCallableOnceWith ('OK ' ));
118
117
$ promise = $ redis ->exec ()->then ($ this ->expectCallableOnceWith ([]));
119
118
120
- await ($ promise, $ this -> loop );
119
+ \ React \ Async \ await ($ promise );
121
120
}
122
121
123
122
public function testMultiExecQueuedExecHasValues ()
@@ -131,7 +130,7 @@ public function testMultiExecQueuedExecHasValues()
131
130
$ redis ->ttl ('b ' )->then ($ this ->expectCallableOnceWith ('QUEUED ' ));
132
131
$ promise = $ redis ->exec ()->then ($ this ->expectCallableOnceWith (['OK ' , 1 , 12 , 20 ]));
133
132
134
- await ($ promise, $ this -> loop );
133
+ \ React \ Async \ await ($ promise );
135
134
}
136
135
137
136
public function testPubSub ()
@@ -152,7 +151,7 @@ public function testPubSub()
152
151
})->then ($ this ->expectCallableOnce ());
153
152
154
153
// expect "message" event to take no longer than 0.1s
155
- await ($ deferred ->promise (), $ this -> loop , 0.1 );
154
+ \ React \ Async \ await ($ deferred ->promise ());
156
155
}
157
156
158
157
public function testClose ()
0 commit comments