IconCollectionTest.php 833 B

1234567891011121314151617181920212223242526272829303132
  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. 'paths' => [
  19. 'feather' => TEST_FILES . 'font_icon/feather/icons.json',
  20. 'material' => TEST_FILES . 'font_icon/material/index.d.ts',
  21. ],
  22. ];
  23. $result = (new IconCollection($config))->names();
  24. $this->assertTrue(count($result['material']) > 1740, 'count of ' . count($result['material']));
  25. $this->assertTrue(in_array('zoom_out', $result['material'], true));
  26. }
  27. }