MaterialIconTest.php 815 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Tools\Test\TestCase\View\Icon;
  3. use Cake\TestSuite\TestCase;
  4. use Tools\View\Icon\MaterialIcon;
  5. class MaterialIconTest extends TestCase {
  6. /**
  7. * @var \Tools\View\Icon\MaterialIcon
  8. */
  9. protected $icon;
  10. /**
  11. * @return void
  12. */
  13. public function setUp(): void {
  14. parent::setUp();
  15. $this->icon = new MaterialIcon();
  16. }
  17. /**
  18. * @return void
  19. */
  20. public function testRender(): void {
  21. $result = $this->icon->render('view');
  22. $this->assertSame('<span class="material-icons">view</span>', $result);
  23. }
  24. /**
  25. * @return void
  26. */
  27. public function testRenderNamespace(): void {
  28. $this->icon = new MaterialIcon(['namespace' => 'material-symbols-outlined']);
  29. $result = $this->icon->render('view');
  30. $this->assertSame('<span class="material-symbols-outlined">view</span>', $result);
  31. }
  32. }