IconCollectionTest.php 882 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Tools\Test\TestCase\View\Icon;
  3. use Cake\TestSuite\TestCase;
  4. use Tools\View\Icon\FeatherIcon;
  5. use Tools\View\Icon\IconCollection;
  6. use Tools\View\Icon\MaterialIcon;
  7. class IconCollectionTest extends TestCase {
  8. /**
  9. * @return void
  10. */
  11. public function testCollect(): void {
  12. $config = [
  13. 'sets' => [
  14. 'feather' => FeatherIcon::class,
  15. 'material' => MaterialIcon::class,
  16. ],
  17. // For being able to parse the available icons
  18. 'config' => [
  19. 'feather' => [
  20. 'path' => TEST_FILES . 'font_icon/feather/icons.json',
  21. ],
  22. 'material' => [
  23. 'path' => TEST_FILES . 'font_icon/material/index.d.ts',
  24. ],
  25. ],
  26. ];
  27. $result = (new IconCollection($config))->names();
  28. $this->assertTrue(count($result['material']) > 1740, 'count of ' . count($result['material']));
  29. $this->assertTrue(in_array('zoom_out', $result['material'], true));
  30. }
  31. }