| @@ 23-37 (lines=15) @@ | ||
| 20 | /** |
|
| 21 | * Test resolve. |
|
| 22 | */ |
|
| 23 | public function testResolve() |
|
| 24 | { |
|
| 25 | $this |
|
| 26 | ->given( |
|
| 27 | $resolveCallback = $this->delegateMockWithReturn('bar'), |
|
| 28 | /** @var \Cubiche\Core\Async\Promise\ObservableResolver $resolver */ |
|
| 29 | $resolver = $this->newTestedInstance($resolveCallback) |
|
| 30 | ) |
|
| 31 | ->when($resolver->resolve('foo')) |
|
| 32 | ->then() |
|
| 33 | ->delegateCall($resolveCallback) |
|
| 34 | ->withArguments('foo') |
|
| 35 | ->once() |
|
| 36 | ; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * Test reject. |
|
| @@ 62-76 (lines=15) @@ | ||
| 59 | /** |
|
| 60 | * Test notify. |
|
| 61 | */ |
|
| 62 | public function testNotify() |
|
| 63 | { |
|
| 64 | $this |
|
| 65 | ->given( |
|
| 66 | $notifyCallback = $this->delegateMock(), |
|
| 67 | /** @var \Cubiche\Core\Async\Promise\ObservableResolver $resolver */ |
|
| 68 | $resolver = $this->newTestedInstance(null, null, $notifyCallback) |
|
| 69 | ) |
|
| 70 | ->when($resolver->notify('foo')) |
|
| 71 | ->then() |
|
| 72 | ->delegateCall($notifyCallback) |
|
| 73 | ->withArguments('foo') |
|
| 74 | ->once() |
|
| 75 | ; |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||