8
8
9
9
class AwaitTest extends TestCase
10
10
{
11
- public function testAwaitThrowsExceptionWhenPromiseIsRejectedWithException ()
11
+ public function testAwaitThrowsExceptionWhenPromiseIsRejectedWithException (): void
12
12
{
13
13
$ promise = new Promise (function () {
14
14
throw new \Exception ('test ' );
@@ -19,7 +19,7 @@ public function testAwaitThrowsExceptionWhenPromiseIsRejectedWithException()
19
19
React \Async \await ($ promise );
20
20
}
21
21
22
- public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithFalse ()
22
+ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithFalse (): void
23
23
{
24
24
if (!interface_exists ('React\Promise\CancellablePromiseInterface ' )) {
25
25
$ this ->markTestSkipped ('Promises must be rejected with a \Throwable instance since Promise v3 ' );
@@ -34,7 +34,7 @@ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWith
34
34
React \Async \await ($ promise );
35
35
}
36
36
37
- public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithNull ()
37
+ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithNull (): void
38
38
{
39
39
if (!interface_exists ('React\Promise\CancellablePromiseInterface ' )) {
40
40
$ this ->markTestSkipped ('Promises must be rejected with a \Throwable instance since Promise v3 ' );
@@ -49,7 +49,7 @@ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWith
49
49
React \Async \await ($ promise );
50
50
}
51
51
52
- public function testAwaitThrowsErrorWhenPromiseIsRejectedWithError ()
52
+ public function testAwaitThrowsErrorWhenPromiseIsRejectedWithError (): void
53
53
{
54
54
$ promise = new Promise (function ($ _ , $ reject ) {
55
55
throw new \Error ('Test ' , 42 );
@@ -61,7 +61,7 @@ public function testAwaitThrowsErrorWhenPromiseIsRejectedWithError()
61
61
React \Async \await ($ promise );
62
62
}
63
63
64
- public function testAwaitReturnsValueWhenPromiseIsFullfilled ()
64
+ public function testAwaitReturnsValueWhenPromiseIsFullfilled (): void
65
65
{
66
66
$ promise = new Promise (function ($ resolve ) {
67
67
$ resolve (42 );
@@ -70,7 +70,7 @@ public function testAwaitReturnsValueWhenPromiseIsFullfilled()
70
70
$ this ->assertEquals (42 , React \Async \await ($ promise ));
71
71
}
72
72
73
- public function testAwaitReturnsValueWhenPromiseIsFulfilledEvenWhenOtherTimerStopsLoop ()
73
+ public function testAwaitReturnsValueWhenPromiseIsFulfilledEvenWhenOtherTimerStopsLoop (): void
74
74
{
75
75
$ promise = new Promise (function ($ resolve ) {
76
76
Loop::addTimer (0.02 , function () use ($ resolve ) {
@@ -84,7 +84,7 @@ public function testAwaitReturnsValueWhenPromiseIsFulfilledEvenWhenOtherTimerSto
84
84
$ this ->assertEquals (2 , React \Async \await ($ promise ));
85
85
}
86
86
87
- public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutRunningLoop ()
87
+ public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutRunningLoop (): void
88
88
{
89
89
$ now = true ;
90
90
@@ -100,7 +100,7 @@ public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutRunningLoop
100
100
$ this ->assertTrue ($ now );
101
101
}
102
102
103
- public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutStoppingLoop ()
103
+ public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutStoppingLoop (): void
104
104
{
105
105
$ ticks = 0 ;
106
106
@@ -128,7 +128,7 @@ public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutStoppingLoo
128
128
$ this ->assertEquals (2 , $ ticks );
129
129
}
130
130
131
- public function testAwaitWithPendingPromiseThatWillResolveWillStopLoopBeforeLastTimerFinishes ()
131
+ public function testAwaitWithPendingPromiseThatWillResolveWillStopLoopBeforeLastTimerFinishes (): void
132
132
{
133
133
$ promise = new Promise (function ($ resolve ) {
134
134
Loop::addTimer (0.02 , function () use ($ resolve ) {
@@ -159,7 +159,7 @@ public function testAwaitWithPendingPromiseThatWillResolveWillStopLoopBeforeLast
159
159
$ this ->assertEquals (1 , $ ticks );
160
160
}
161
161
162
- public function testAwaitWithAlreadyRejectedPromiseWillReturnWithoutStoppingLoop ()
162
+ public function testAwaitWithAlreadyRejectedPromiseWillReturnWithoutStoppingLoop (): void
163
163
{
164
164
$ ticks = 0 ;
165
165
@@ -191,7 +191,7 @@ public function testAwaitWithAlreadyRejectedPromiseWillReturnWithoutStoppingLoop
191
191
$ this ->assertEquals (2 , $ ticks );
192
192
}
193
193
194
- public function testAwaitWithPendingPromiseThatWillRejectWillStopLoopBeforeLastTimerFinishes ()
194
+ public function testAwaitWithPendingPromiseThatWillRejectWillStopLoopBeforeLastTimerFinishes (): void
195
195
{
196
196
$ promise = new Promise (function ($ _ , $ reject ) {
197
197
Loop::addTimer (0.02 , function () use (&$ reject ) {
@@ -227,7 +227,7 @@ public function testAwaitWithPendingPromiseThatWillRejectWillStopLoopBeforeLastT
227
227
$ this ->assertEquals (1 , $ ticks );
228
228
}
229
229
230
- public function testAwaitShouldNotCreateAnyGarbageReferencesForResolvedPromise ()
230
+ public function testAwaitShouldNotCreateAnyGarbageReferencesForResolvedPromise (): void
231
231
{
232
232
if (class_exists ('React\Promise\When ' )) {
233
233
$ this ->markTestSkipped ('Not supported on legacy Promise v1 API ' );
@@ -244,7 +244,7 @@ public function testAwaitShouldNotCreateAnyGarbageReferencesForResolvedPromise()
244
244
$ this ->assertEquals (0 , gc_collect_cycles ());
245
245
}
246
246
247
- public function testAwaitShouldNotCreateAnyGarbageReferencesForRejectedPromise ()
247
+ public function testAwaitShouldNotCreateAnyGarbageReferencesForRejectedPromise (): void
248
248
{
249
249
if (class_exists ('React\Promise\When ' )) {
250
250
$ this ->markTestSkipped ('Not supported on legacy Promise v1 API ' );
@@ -265,7 +265,7 @@ public function testAwaitShouldNotCreateAnyGarbageReferencesForRejectedPromise()
265
265
$ this ->assertEquals (0 , gc_collect_cycles ());
266
266
}
267
267
268
- public function testAwaitShouldNotCreateAnyGarbageReferencesForPromiseRejectedWithNullValue ()
268
+ public function testAwaitShouldNotCreateAnyGarbageReferencesForPromiseRejectedWithNullValue (): void
269
269
{
270
270
if (!interface_exists ('React\Promise\CancellablePromiseInterface ' )) {
271
271
$ this ->markTestSkipped ('Promises must be rejected with a \Throwable instance since Promise v3 ' );
0 commit comments