/** * @test */ public function wordSpacingHasAnImpactOnWidth() { $words = 'some more words'; $width = 100; $linePart = new LinePart($words, $width, 0, new Text()); $wordSpacing = 5; $linePart->setWordSpacing($wordSpacing); $expectedWidth = $width + ($linePart->getNumberOfWords() - 1) * $wordSpacing; $this->assertEquals($expectedWidth, $linePart->getWidth()); }
public function addPart(LinePart $linePart) { $linePart->setLine($this); $this->parts[] = $linePart; }