88
99class AwaitTest extends TestCase
1010{
11- public function testAwaitThrowsExceptionWhenPromiseIsRejectedWithException ()
11+ public function testAwaitThrowsExceptionWhenPromiseIsRejectedWithException (): void
1212 {
1313 $ promise = new Promise (function () {
1414 throw new \Exception ('test ' );
@@ -19,7 +19,7 @@ public function testAwaitThrowsExceptionWhenPromiseIsRejectedWithException()
1919 React \Async \await ($ promise );
2020 }
2121
22- public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithFalse ()
22+ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithFalse (): void
2323 {
2424 if (!interface_exists ('React\Promise\CancellablePromiseInterface ' )) {
2525 $ this ->markTestSkipped ('Promises must be rejected with a \Throwable instance since Promise v3 ' );
@@ -34,7 +34,7 @@ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWith
3434 React \Async \await ($ promise );
3535 }
3636
37- public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithNull ()
37+ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithNull (): void
3838 {
3939 if (!interface_exists ('React\Promise\CancellablePromiseInterface ' )) {
4040 $ this ->markTestSkipped ('Promises must be rejected with a \Throwable instance since Promise v3 ' );
@@ -49,7 +49,7 @@ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWith
4949 React \Async \await ($ promise );
5050 }
5151
52- public function testAwaitThrowsErrorWhenPromiseIsRejectedWithError ()
52+ public function testAwaitThrowsErrorWhenPromiseIsRejectedWithError (): void
5353 {
5454 $ promise = new Promise (function ($ _ , $ reject ) {
5555 throw new \Error ('Test ' , 42 );
@@ -61,7 +61,7 @@ public function testAwaitThrowsErrorWhenPromiseIsRejectedWithError()
6161 React \Async \await ($ promise );
6262 }
6363
64- public function testAwaitReturnsValueWhenPromiseIsFullfilled ()
64+ public function testAwaitReturnsValueWhenPromiseIsFullfilled (): void
6565 {
6666 $ promise = new Promise (function ($ resolve ) {
6767 $ resolve (42 );
@@ -70,7 +70,7 @@ public function testAwaitReturnsValueWhenPromiseIsFullfilled()
7070 $ this ->assertEquals (42 , React \Async \await ($ promise ));
7171 }
7272
73- public function testAwaitReturnsValueWhenPromiseIsFulfilledEvenWhenOtherTimerStopsLoop ()
73+ public function testAwaitReturnsValueWhenPromiseIsFulfilledEvenWhenOtherTimerStopsLoop (): void
7474 {
7575 $ promise = new Promise (function ($ resolve ) {
7676 Loop::addTimer (0.02 , function () use ($ resolve ) {
@@ -84,7 +84,7 @@ public function testAwaitReturnsValueWhenPromiseIsFulfilledEvenWhenOtherTimerSto
8484 $ this ->assertEquals (2 , React \Async \await ($ promise ));
8585 }
8686
87- public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutRunningLoop ()
87+ public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutRunningLoop (): void
8888 {
8989 $ now = true ;
9090
@@ -100,7 +100,7 @@ public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutRunningLoop
100100 $ this ->assertTrue ($ now );
101101 }
102102
103- public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutStoppingLoop ()
103+ public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutStoppingLoop (): void
104104 {
105105 $ ticks = 0 ;
106106
@@ -128,7 +128,7 @@ public function testAwaitWithAlreadyFulfilledPromiseWillReturnWithoutStoppingLoo
128128 $ this ->assertEquals (2 , $ ticks );
129129 }
130130
131- public function testAwaitWithPendingPromiseThatWillResolveWillStopLoopBeforeLastTimerFinishes ()
131+ public function testAwaitWithPendingPromiseThatWillResolveWillStopLoopBeforeLastTimerFinishes (): void
132132 {
133133 $ promise = new Promise (function ($ resolve ) {
134134 Loop::addTimer (0.02 , function () use ($ resolve ) {
@@ -159,7 +159,7 @@ public function testAwaitWithPendingPromiseThatWillResolveWillStopLoopBeforeLast
159159 $ this ->assertEquals (1 , $ ticks );
160160 }
161161
162- public function testAwaitWithAlreadyRejectedPromiseWillReturnWithoutStoppingLoop ()
162+ public function testAwaitWithAlreadyRejectedPromiseWillReturnWithoutStoppingLoop (): void
163163 {
164164 $ ticks = 0 ;
165165
@@ -191,7 +191,7 @@ public function testAwaitWithAlreadyRejectedPromiseWillReturnWithoutStoppingLoop
191191 $ this ->assertEquals (2 , $ ticks );
192192 }
193193
194- public function testAwaitWithPendingPromiseThatWillRejectWillStopLoopBeforeLastTimerFinishes ()
194+ public function testAwaitWithPendingPromiseThatWillRejectWillStopLoopBeforeLastTimerFinishes (): void
195195 {
196196 $ promise = new Promise (function ($ _ , $ reject ) {
197197 Loop::addTimer (0.02 , function () use (&$ reject ) {
@@ -227,7 +227,7 @@ public function testAwaitWithPendingPromiseThatWillRejectWillStopLoopBeforeLastT
227227 $ this ->assertEquals (1 , $ ticks );
228228 }
229229
230- public function testAwaitShouldNotCreateAnyGarbageReferencesForResolvedPromise ()
230+ public function testAwaitShouldNotCreateAnyGarbageReferencesForResolvedPromise (): void
231231 {
232232 if (class_exists ('React\Promise\When ' )) {
233233 $ this ->markTestSkipped ('Not supported on legacy Promise v1 API ' );
@@ -244,7 +244,7 @@ public function testAwaitShouldNotCreateAnyGarbageReferencesForResolvedPromise()
244244 $ this ->assertEquals (0 , gc_collect_cycles ());
245245 }
246246
247- public function testAwaitShouldNotCreateAnyGarbageReferencesForRejectedPromise ()
247+ public function testAwaitShouldNotCreateAnyGarbageReferencesForRejectedPromise (): void
248248 {
249249 if (class_exists ('React\Promise\When ' )) {
250250 $ this ->markTestSkipped ('Not supported on legacy Promise v1 API ' );
@@ -265,7 +265,7 @@ public function testAwaitShouldNotCreateAnyGarbageReferencesForRejectedPromise()
265265 $ this ->assertEquals (0 , gc_collect_cycles ());
266266 }
267267
268- public function testAwaitShouldNotCreateAnyGarbageReferencesForPromiseRejectedWithNullValue ()
268+ public function testAwaitShouldNotCreateAnyGarbageReferencesForPromiseRejectedWithNullValue (): void
269269 {
270270 if (!interface_exists ('React\Promise\CancellablePromiseInterface ' )) {
271271 $ this ->markTestSkipped ('Promises must be rejected with a \Throwable instance since Promise v3 ' );
0 commit comments