public function setParent(Container $node) { parent::setParent($node); foreach ($this->listeners as $listener) { $listener->parentBind($this); } }
/** * @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()); }
public function setWatermark(Container $watermark) { $watermark->setParent($this); $watermark->setAttribute('vertical-align', self::VERTICAL_ALIGN_MIDDLE); $watermark->setHeight($this->getHeight()); $watermark->setWidth($this->getWidth()); $watermark->setBoundary(clone $this->getBoundary()); $this->watermark = $watermark; }