Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function testLinearUsher() |
||
14 | { |
||
15 | $factory = FontsFactory::create(__DIR__ . '/../fixtures/fonts'); |
||
16 | $metrics = new FontMetrics($factory); |
||
17 | $placer = PlacerFactory::getInstance()->getPlacer(PlacerFactory::PLACER_LINEAR_H, 800, 600, 5); |
||
18 | $usher = new Usher(800, 600, $placer, $metrics); |
||
19 | $place1 = $usher->getPlace('foobar', 'Arial.ttf', 12, 0); |
||
20 | // Assert the first word is positioned at (0,0) |
||
21 | $this->assertEquals(new Point(0, 0), $place1->getPosition()); |
||
22 | |||
23 | $place2 = $usher->getPlace('foobar', 'Arial.ttf', 12, 90); |
||
24 | // Assert the second word is placed on the right of the first word |
||
25 | $this->assertEquals(0, $place2->getY()); |
||
26 | $this->assertTrue($place1->getWidth() <= $place2->getX()); |
||
27 | } |
||
28 | } |
||
29 |