FontAwesome4IconTest.php 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace Tools\Test\TestCase\View\Icon;
  3. use Cake\TestSuite\TestCase;
  4. use Tools\View\Icon\FontAwesome4Icon;
  5. class FontAwesome4IconTest extends TestCase {
  6. /**
  7. * @var \Tools\View\Icon\FontAwesome4Icon
  8. */
  9. protected $icon;
  10. /**
  11. * @return void
  12. */
  13. public function setUp(): void {
  14. parent::setUp();
  15. $this->icon = new FontAwesome4Icon();
  16. }
  17. /**
  18. * @return void
  19. */
  20. public function testRender(): void {
  21. $result = $this->icon->render('camera-retro');
  22. $this->assertSame('<span class="fa fa-camera-retro"></span>', $result);
  23. }
  24. /**
  25. * @return void
  26. */
  27. public function testRenderRotate(): void {
  28. $result = $this->icon->render('camera-retro', ['rotate' => 90]);
  29. $this->assertSame('<span class="fa fa-rotate-90 fa-camera-retro"></span>', $result);
  30. }
  31. /**
  32. * @return void
  33. */
  34. public function testRenderSpin(): void {
  35. $result = $this->icon->render('camera-retro', ['spin' => true]);
  36. $this->assertSame('<span class="fa fa-spin fa-camera-retro"></span>', $result);
  37. }
  38. }