Example #1
0
 public function testSetWidth()
 {
     // Arrange
     // ...
     // Act
     $this->part->setWidth('anotherWidth');
     // Assert
     $this->assertEquals('anotherWidth', $this->part->getWidth());
 }
Example #2
0
 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;
 }