You are here

class RejectionExceptionTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php \GuzzleHttp\Promise\Tests\RejectionExceptionTest

@covers GuzzleHttp\Promise\RejectionException

Hierarchy

  • class \GuzzleHttp\Promise\Tests\RejectionExceptionTest extends \GuzzleHttp\Promise\Tests\PHPUnit_Framework_TestCase

Expanded class hierarchy of RejectionExceptionTest

File

vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php, line 30

Namespace

GuzzleHttp\Promise\Tests
View source
class RejectionExceptionTest extends \PHPUnit_Framework_TestCase {
  public function testCanGetReasonFromException() {
    $thing = new Thing1('foo');
    $e = new RejectionException($thing);
    $this
      ->assertSame($thing, $e
      ->getReason());
    $this
      ->assertEquals('The promise was rejected with reason: foo', $e
      ->getMessage());
  }
  public function testCanGetReasonMessageFromJson() {
    $reason = new Thing2();
    $e = new RejectionException($reason);
    $this
      ->assertContains("{}", $e
      ->getMessage());
  }

}

Members