@@ 116-132 (lines=17) @@ | ||
113 | /** |
|
114 | * Test notify. |
|
115 | */ |
|
116 | public function testNotify() |
|
117 | { |
|
118 | $this |
|
119 | ->given( |
|
120 | $promise = $this->newDefaultTestedInstance(), |
|
121 | $onNotify = $this->delegateMock() |
|
122 | ) |
|
123 | ->when(function () use ($promise, $onNotify) { |
|
124 | $promise->then(null, null, $onNotify); |
|
125 | $this->notify('foo'); |
|
126 | }) |
|
127 | ->then() |
|
128 | ->delegateCall($onNotify) |
|
129 | ->withArguments('foo') |
|
130 | ->once() |
|
131 | ; |
|
132 | } |
|
133 | ||
134 | /** |
|
135 | * {@inheritdoc} |
@@ 113-130 (lines=18) @@ | ||
110 | /** |
|
111 | * Test notify. |
|
112 | */ |
|
113 | public function testNotify() |
|
114 | { |
|
115 | $this |
|
116 | ->given( |
|
117 | /** @var \Cubiche\Core\Async\Promise\DeferredInterface $deferred */ |
|
118 | $deferred = $this->newDefaultTestedInstance(), |
|
119 | $onNotify = $this->delegateMock() |
|
120 | ) |
|
121 | ->when(function () use ($deferred, $onNotify) { |
|
122 | $deferred->promise()->then(null, null, $onNotify); |
|
123 | $deferred->notify('foo'); |
|
124 | }) |
|
125 | ->then() |
|
126 | ->delegateCall($onNotify) |
|
127 | ->withArguments('foo') |
|
128 | ->once() |
|
129 | ; |
|
130 | } |
|
131 | ||
132 | /** |
|
133 | * Test cancel. |