/** * @expectedException InvalidArgumentException */ public function testSetBorderRadiusWithInvalidNumber() { // Arrange $badge = new Badge(); // Act $badge->setBorderRadius('abc'); // Assert // ... }
public function testRenderTwoPartWithBorderAndPredifinedWidth() { // Arrange $renderer = new SvgRenderer(new GdWidthCalculator()); $font = new Font(12, 'verdana', 'fonts/verdana.ttf'); $badge = new Badge(); $badge->setBorderRadius(3); $badge->addPart(new Part('text1', 'red', 'blue', $font, 100)); $badge->addPart(new Part('text2', 'blue', 'red', $font, 200)); // Act $result = $renderer->render($badge); // Assert $this->assertStringEqualsFile('tests/BadgeTestAsset/with-border-two-parts-predefined.svg', $result); }