slug())); } } public function testSlugsAreUnique(): void { $slugs = array_map(static fn (ResourceType $type): string => $type->slug(), ResourceType::cases()); self::assertSame($slugs, array_unique($slugs)); } public function testAnUnknownSlugIsRejected(): void { $this->expectException(\ValueError::class); ResourceType::fromSlug('fahrraeder'); } /** * The URL slugs are German while the backing values stay English, because the values are * persisted in resource.type and renaming them would need a migration. */ public function testTheSlugIsNotTheStoredValue(): void { self::assertSame('desk', ResourceType::DESK->value); self::assertSame('schreibtische', ResourceType::DESK->slug()); } /** * Every case must carry the presentation a dashboard tile needs, or adding one would produce * a broken tile rather than a working one. */ public function testEveryCaseIsFullyDescribed(): void { foreach (ResourceType::cases() as $type) { self::assertNotSame('', $type->label()); self::assertNotSame('', $type->plural()); self::assertNotSame('', $type->description()); self::assertStringStartsWith('lucide:', $type->icon()); } } }