@@ -29,7 +29,7 @@ function () {
29
29
},
30
30
function () {
31
31
return new Promise (function ($ resolve ) {
32
- Loop::addTimer (0.1 , function () use ($ resolve ) {
32
+ Loop::addTimer (0.11 , function () use ($ resolve ) {
33
33
$ resolve ('bar ' );
34
34
});
35
35
});
@@ -49,7 +49,7 @@ function () {
49
49
$ timer ->assertInRange (0.1 , 0.2 );
50
50
}
51
51
52
- public function testParallelWithError ()
52
+ public function testParallelWithErrorReturnsPromiseRejectedWithExceptionFromTaskAndStopsCallingAdditionalTasks ()
53
53
{
54
54
$ called = 0 ;
55
55
@@ -60,7 +60,8 @@ function () use (&$called) {
60
60
$ resolve ('foo ' );
61
61
});
62
62
},
63
- function () {
63
+ function () use (&$ called ) {
64
+ $ called ++;
64
65
return new Promise (function () {
65
66
throw new \RuntimeException ('whoops ' );
66
67
});
@@ -80,7 +81,7 @@ function () use (&$called) {
80
81
$ this ->assertSame (2 , $ called );
81
82
}
82
83
83
- public function testParallelWithDelayedError ()
84
+ public function testParallelWithDelayedErrorReturnsPromiseRejectedWithExceptionFromTask ()
84
85
{
85
86
$ called = 0 ;
86
87
@@ -91,7 +92,8 @@ function () use (&$called) {
91
92
$ resolve ('foo ' );
92
93
});
93
94
},
94
- function () {
95
+ function () use (&$ called ) {
96
+ $ called ++;
95
97
return new Promise (function ($ _ , $ reject ) {
96
98
Loop::addTimer (0.001 , function () use ($ reject ) {
97
99
$ reject (new \RuntimeException ('whoops ' ));
@@ -112,6 +114,6 @@ function () use (&$called) {
112
114
113
115
Loop::run ();
114
116
115
- $ this ->assertSame (2 , $ called );
117
+ $ this ->assertSame (3 , $ called );
116
118
}
117
119
}
0 commit comments