/** * @test */ public function graphicContextIfFetchedFromPage() { $graphicContextStub = 'some stub'; $pageMock = $this->getMock('PHPPdf\\Core\\Node\\Page', array('getGraphicsContext')); $pageMock->expects($this->once())->method('getGraphicsContext')->will($this->returnValue($graphicContextStub)); $this->node->setParent($pageMock); $this->assertEquals($graphicContextStub, $this->node->getGraphicsContext()); }