/** * @test * @expectedException Exception */ public function handleErrorThrowsExceptionForOwnRequests() { /** @var \R3H6\Error404page\Domain\Model\Error $errorFixture */ $errorFixture = new Error(); $this->httpServiceMock->expects($this->once())->method('isOwnRequest')->will($this->returnValue(true)); $this->subject->handleError($errorFixture); }
/** * @test */ public function handleErrorReturnsTrueIfPageIsFound() { $expected = 'Error 404'; /** @var \R3H6\Error404page\Domain\Model\Error $errorFixture */ $errorFixture = new Error(); /** @var \R3H6\Error404page\Domain\Model\Error $pageMock */ $pageMock = $this->getPageMock(404, 'test'); $this->pageRepositoryMock->expects($this->once())->method('find404PageForError')->with($errorFixture)->will($this->returnValue($pageMock)); $this->httpServiceMock->expects($this->once())->method('readUrl')->with($this->equalTo('test'))->will($this->returnValue($expected)); $this->assertTrue($this->subject->handleError($errorFixture)); $this->assertSame($expected, $this->subject->getCachingData()); $this->assertContains('pageId_404', $this->subject->getCacheTags()); }