/** * @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()); }
/** * @test */ public function testConstruct() { $exception = new TmdbApiException('abc', 1); $this->assertEquals('abc', $exception->getMessage()); $this->assertEquals(1, $exception->getCode()); }