/** * @test */ public function addLinePartToTextOnLinePartCreation() { $text = $this->getMockBuilder('PHPPdf\\Core\\Node\\Text')->setMethods(array('addLinePart', 'removeLinePart'))->getMock(); $text->expects($this->at(0))->method('addLinePart')->with($this->isInstanceOf('PHPPdf\\Core\\Node\\Paragraph\\LinePart')); $text->expects($this->at(1))->method('removeLinePart')->with($this->isInstanceOf('PHPPdf\\Core\\Node\\Paragraph\\LinePart')); $linePart = new LinePart('', 0, 0, $text); $newText = $this->getMockBuilder('PHPPdf\\Core\\Node\\Text')->setMethods(array('addLinePart'))->getMock(); $newText->expects($this->at(0))->method('addLinePart')->with($this->isInstanceOf('PHPPdf\\Core\\Node\\Paragraph\\LinePart')); $linePart->setText($newText); }