chore: code cleanup

This commit is contained in:
fromme committed 2026-09-17 16:10:34 +02:00
1 parent 1a3640b15c
commit 5a01054b0e
65 files changed
+1046 -795

No files matched your search

+1 -1
View File
@@ -6,8 +6,8 @@ namespace App\Tests\Entity;
use App\Entity\Booking;
use App\Entity\Resource;
use App\Entity\ResourceType;
use App\Entity\User;
use App\Enum\ResourceType;
use PHPUnit\Framework\TestCase;
class BookingTest extends TestCase
-48
View File
@@ -1,48 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Tests\Entity;
use App\Entity\ResourceType;
use PHPUnit\Framework\TestCase;
class ResourceTypeTest extends TestCase
{
/**
* The backing value is what appears in a URL, so it has to survive the round trip -- there
* is deliberately no separate slug mapping to keep in sync.
*/
public function testEveryValueResolvesBackToItsCase(): void
{
foreach (ResourceType::cases() as $type) {
self::assertSame($type, ResourceType::tryFrom($type->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());
}
}
}