value)); } } public function testAnUnknownValueResolvesToNothing(): void { self::assertNull(ResourceType::tryFrom('bikes')); } public function testValuesAreUrlSafe(): void { foreach (ResourceType::cases() as $type) { self::assertMatchesRegularExpression('/^[a-z]+$/', $type->value); } } /** * 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()); } } }