You are here

public function PromiseTest::testCannotRejectNonPendingPromise in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/promises/tests/PromiseTest.php \GuzzleHttp\Promise\Tests\PromiseTest::testCannotRejectNonPendingPromise()

@expectedException \LogicException @expectedExceptionMessage Cannot change a fulfilled promise to rejected

File

vendor/guzzlehttp/promises/tests/PromiseTest.php, line 38

Class

PromiseTest
@covers GuzzleHttp\Promise\Promise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testCannotRejectNonPendingPromise() {
  $p = new Promise();
  $p
    ->resolve('foo');
  $p
    ->reject('bar');
  $this
    ->assertEquals('foo', $p
    ->wait());
}