IconCollectionTest.php 806 B

123456789101112131415161718192021222324252627282930313233
  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' => [
  15. 'class' => FeatherIcon::class,
  16. 'path' => TEST_FILES . 'font_icon/feather/icons.json',
  17. ],
  18. 'material' => [
  19. 'class' => MaterialIcon::class,
  20. 'path' => TEST_FILES . 'font_icon/material/index.d.ts',
  21. ],
  22. ],
  23. ];
  24. $result = (new IconCollection($config))->names();
  25. $this->assertTrue(count($result['material']) > 1740, 'count of ' . count($result['material']));
  26. $this->assertTrue(in_array('zoom_out', $result['material'], true));
  27. }
  28. }