|
@@ 159-169 (lines=11) @@
|
| 156 |
|
$this->assertEquals('FormattedRequest', $profile->getRequest()); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
public function testOnFulfilled() |
| 160 |
|
{ |
| 161 |
|
$promise = $this->subject->handleRequest($this->request, function () { |
| 162 |
|
return $this->fulfilledPromise; |
| 163 |
|
}, function () { |
| 164 |
|
}); |
| 165 |
|
|
| 166 |
|
$this->assertEquals($this->response, $promise->wait()); |
| 167 |
|
$profile = $this->currentStack->getProfiles()[0]; |
| 168 |
|
$this->assertEquals('FormattedResponse', $profile->getResponse()); |
| 169 |
|
} |
| 170 |
|
|
| 171 |
|
/** |
| 172 |
|
* @expectedException \Http\Client\Exception\TransferException |
|
@@ 174-184 (lines=11) @@
|
| 171 |
|
/** |
| 172 |
|
* @expectedException \Http\Client\Exception\TransferException |
| 173 |
|
*/ |
| 174 |
|
public function testOnRejected() |
| 175 |
|
{ |
| 176 |
|
$promise = $this->subject->handleRequest($this->request, function () { |
| 177 |
|
return $this->rejectedPromise; |
| 178 |
|
}, function () { |
| 179 |
|
}); |
| 180 |
|
|
| 181 |
|
$this->assertEquals($this->exception, $promise->wait()); |
| 182 |
|
$profile = $this->currentStack->getProfiles()[0]; |
| 183 |
|
$this->assertEquals('FormattedException', $profile->getResponse()); |
| 184 |
|
} |
| 185 |
|
} |
| 186 |
|
|