public function testGetFont() { // Arrange // ... // Act $value = $this->part->getFont(); // Assert $this->assertInstanceOf('PHP\\Badge\\Font\\Font', $this->font); $this->assertEquals($this->font, $value); }
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; }