public function testSetWidth() { // Arrange // ... // Act $this->part->setWidth('anotherWidth'); // Assert $this->assertEquals('anotherWidth', $this->part->getWidth()); }
private function calculateWidth(Part $part) { $textWidth = $this->widthCalculator->getWidth($part->getText(), $part->getFont()) + 10; if (!$part->getWidth()) { $width = $textWidth; } else { $width = $part->getWidth(); } return $width; }