public function RejectedPromiseTest::testCanResolveThenWithSuccess in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php \GuzzleHttp\Promise\Tests\RejectedPromiseTest::testCanResolveThenWithSuccess()
File
- vendor/
guzzlehttp/ promises/ tests/ RejectedPromiseTest.php, line 123
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testCanResolveThenWithSuccess() {
$actual = null;
$p = new RejectedPromise('foo');
$p
->otherwise(function ($v) {
return $v . ' bar';
})
->then(function ($v) use (&$actual) {
$actual = $v;
});
\GuzzleHttp\Promise\queue()
->run();
$this
->assertEquals('foo bar', $actual);
}