Symbole: alle Lucide-Symbole lokal verfügbar
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

- 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>
This commit is contained in:
Friederich Loheide 2026-09-26 14:50:13 +00:00
parent 23c36d28b5
commit c71131d054
151 changed files with 4621 additions and 512 deletions

View file

@ -6,35 +6,40 @@ use App\Support\Icons;
use Tests\TestCase;
/**
* Liste, SVG-Daten und Frontend-Zuordnung müssen zusammenpassen
* (nach Änderungen an resources/icons/icons.json: npm run icons).
* 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_generated_files_match_the_list(): void
public function test_all_icons_are_available_locally(): void
{
$names = array_keys(Icons::choices());
$svg = require resource_path('icons/svg.php');
$js = file_get_contents(resource_path('js/lib/icons.js'));
$this->assertSame($names, array_keys($svg), 'resources/icons/svg.php veraltet – npm run icons');
foreach ($names as $name) {
$this->assertStringContainsString("'{$name}':", $js, "icons.js ohne „{$name}“ – npm run icons");
$this->assertNotSame('', $svg[$name]);
}
// Bereits gespeicherte Schnellzugriffe nutzen diese Namen.
foreach (['link', 'building-2', 'heart-handshake', 'utensils'] as $legacy) {
$this->assertTrue(Icons::has($legacy));
}
$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_options_are_safe_html_and_searchable(): void
public function test_curated_icons_exist_and_are_bundled(): void
{
$this->assertStringContainsString('<svg', Icons::options()['house']);
$this->assertArrayHasKey('house', Icons::search('startseite'));
$this->assertArrayNotHasKey('house', Icons::search('path'), 'Suche trifft nicht das SVG-Markup');
$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>'));
}
}