diff --git a/src/Executor/Promise/Adapter/SyncPromiseAdapter.php b/src/Executor/Promise/Adapter/SyncPromiseAdapter.php index 1b3dd31..35341b3 100644 --- a/src/Executor/Promise/Adapter/SyncPromiseAdapter.php +++ b/src/Executor/Promise/Adapter/SyncPromiseAdapter.php @@ -96,6 +96,7 @@ class SyncPromiseAdapter implements PromiseAdapter foreach ($promisesOrValues as $index => $promiseOrValue) { if ($promiseOrValue instanceof Promise) { + $result[$index] = null; $promiseOrValue->then( function($value) use ($index, &$count, $total, &$result, $all) { $result[$index] = $value; diff --git a/tests/Executor/Promise/SyncPromiseAdapterTest.php b/tests/Executor/Promise/SyncPromiseAdapterTest.php index c94271e..a192409 100644 --- a/tests/Executor/Promise/SyncPromiseAdapterTest.php +++ b/tests/Executor/Promise/SyncPromiseAdapterTest.php @@ -186,18 +186,18 @@ class SyncPromiseAdapterTest extends \PHPUnit_Framework_TestCase } ); - $this->assertEquals($onFulfilledCalled, false); - $this->assertEquals($onRejectedCalled, false); + $this->assertSame($onFulfilledCalled, false); + $this->assertSame($onRejectedCalled, false); SyncPromise::runQueue(); if ($expectedNextState !== SyncPromise::PENDING) { - $this->assertEquals(!$expectedNextReason, $onFulfilledCalled); - $this->assertEquals(!!$expectedNextReason, $onRejectedCalled); + $this->assertSame(!$expectedNextReason, $onFulfilledCalled); + $this->assertSame(!!$expectedNextReason, $onRejectedCalled); } - $this->assertEquals($expectedNextValue, $actualNextValue); - $this->assertEquals($expectedNextReason, $actualNextReason); - $this->assertEquals($expectedNextState, $promise->adoptedPromise->state); + $this->assertSame($expectedNextValue, $actualNextValue); + $this->assertSame($expectedNextReason, $actualNextReason); + $this->assertSame($expectedNextState, $promise->adoptedPromise->state); } }