Loheide-eu-mitarbeiterplatt.../tests/Unit/IconsTest.php
Friederich Loheide c71131d054
All checks were successful
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m35s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m37s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m41s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m52s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m56s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 4m2s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 4m21s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 4m5s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s
Symbole: alle Lucide-Symbole lokal verfügbar
- Vollständiger Satz (1.854 Symbole + Aliase älterer Namen) in
  resources/icons/svg.php (Admin) und resources/js/lib/icon-set.js
  (Portal, wird nur bei Bedarf geladen)
- Kuratierte 66 mit deutscher Bezeichnung bleiben im Hauptpaket und
  stehen in Auswahlfeldern vorne; die Suche findet alle
- AppIcon-Komponente für Menü, Schnellzugriffe und Pagebuilder;
  Symbolfeld im Pagebuilder mit Suche

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 14:50:13 +00:00

45 lines
1.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace Tests\Unit;
use App\Support\Icons;
use Tests\TestCase;
/**
* Alle Lucide-Symbole lokal; kuratierte Auswahl mit deutschen Bezeichnungen
* (nach Änderungen an resources/icons/icons.json oder Lucide: npm run icons).
*/
class IconsTest extends TestCase
{
public function test_all_icons_are_available_locally(): void
{
$this->assertGreaterThan(1800, count(Icons::names()));
$this->assertTrue(Icons::has('calendar-check'));
$this->assertStringContainsString('<path', Icons::svg('calendar-check'));
$this->assertStringContainsString('export default', file_get_contents(resource_path('js/lib/icon-set.js')));
}
public function test_curated_icons_exist_and_are_bundled(): void
{
$js = file_get_contents(resource_path('js/lib/icons.js'));
foreach (array_keys(Icons::choices()) as $name) {
$this->assertTrue(Icons::has($name), "„{$name}“ fehlt im Symbolsatz – npm run icons");
$this->assertStringContainsString("'{$name}':", $js, "icons.js ohne „{$name}“ – npm run icons");
}
// Gespeicherte Werte älterer Lucide-Namen bleiben gültig.
$this->assertSame('building-complex', Icons::resolve('building-2'));
$this->assertStringContainsString('<path', Icons::svg('building-2'));
}
public function test_search_covers_all_icons_but_never_markup(): void
{
$this->assertArrayHasKey('house', Icons::search('startseite'), 'Deutsche Bezeichnung der kuratierten Auswahl');
$this->assertArrayHasKey('calendar-check', Icons::search('calendar-check'), 'Englische Namen aller Symbole');
$this->assertArrayNotHasKey('house', Icons::search('path'));
$this->assertLessThanOrEqual(60, count(Icons::search('a')));
$this->assertSame(Icons::options(), Icons::search(''));
$this->assertFalse(Icons::has('<script>'));
}
}