FontAwesome5CollectorTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Tools\Test\TestCase\View\Icon\Collector;
  3. use Cake\TestSuite\TestCase;
  4. use Tools\View\Icon\Collector\FontAwesome5IconCollector;
  5. class FontAwesome5CollectorTest extends TestCase {
  6. /**
  7. * Show that we are still API compatible/valid.
  8. *
  9. * @return void
  10. */
  11. public function testCollect(): void {
  12. $path = TEST_FILES . 'font_icon' . DS . 'fa5' . DS . 'icons.json';
  13. $result = FontAwesome5IconCollector::collect($path);
  14. $this->assertTrue(count($result) > 1456, 'count of ' . count($result));
  15. $this->assertTrue(in_array('thumbs-up', $result, true));
  16. }
  17. /**
  18. * Show that we are still API compatible/valid.
  19. *
  20. * @return void
  21. */
  22. public function testCollectSvg(): void {
  23. $path = TEST_FILES . 'font_icon' . DS . 'fa5' . DS . 'solid.svg';
  24. $result = FontAwesome5IconCollector::collect($path);
  25. $this->assertTrue(count($result) > 1000, 'count of ' . count($result));
  26. $this->assertTrue(in_array('thumbs-up', $result, true));
  27. }
  28. /**
  29. * Show that we are still API compatible/valid.
  30. *
  31. * @return void
  32. */
  33. public function testCollectYml(): void {
  34. $path = TEST_FILES . 'font_icon' . DS . 'fa5' . DS . 'icons.yml';
  35. $result = FontAwesome5IconCollector::collect($path);
  36. $this->assertTrue(count($result) > 1400, 'count of ' . count($result));
  37. $this->assertTrue(in_array('thumbs-up', $result, true));
  38. }
  39. }