/** * {@inheritdoc} */ protected function doApply(CanvasInterface $canvas) { $dimension = $this->getBox()->getDimension(); $coordinate = $this->getBox()->getCoordinate(); $new = new Canvas($dimension); $new->paste($canvas, new Box($dimension, $coordinate), new Box($dimension)); $canvas->destroy(); $canvas->setHandler($new->getHandler()); }
/** * @dataProvider canvasProvider * * @param \Jaguar\Canvas $canvas */ public function testSetGetHandler(Canvas $canvas) { $new = new Canvas(new Dimension(100, 100)); $this->assertSame($canvas, $canvas->setHandler($new->getHandler())); $this->assertSame($canvas->getHandler(), $new->getHandler()); }