コード例 #1
0
 /**
  * @test
  */
 public function testConstruct()
 {
     $exception = new TmdbApiException(1, 'code', new Request(), new Response());
     $this->assertEquals(1, $exception->getCode());
     $this->assertEquals('code', $exception->getMessage());
     $this->assertEquals(new Request(), $exception->getRequest());
     $this->assertEquals(new Response(), $exception->getResponse());
     $exception->setRequest(new Request('/bla'));
     $exception->setResponse(new Response(404));
     $this->assertEquals('/bla', $exception->getRequest()->getPath());
     $this->assertEquals(404, $exception->getResponse()->getCode());
 }
コード例 #2
0
ファイル: TmdbApiExceptionTest.php プロジェクト: n10ty/api
 /**
  * @test
  */
 public function testConstruct()
 {
     $exception = new TmdbApiException('abc', 1);
     $this->assertEquals('abc', $exception->getMessage());
     $this->assertEquals(1, $exception->getCode());
 }