feat: add the booking domain layer
This commit is contained in:
1 parent
ef8a88ed2a
commit
cb407477bf
13 files changed
+693
-6
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Entity;
|
||||
|
||||
use App\Entity\Booking;
|
||||
use App\Entity\Resource;
|
||||
use App\Entity\ResourceType;
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class BookingTest extends TestCase
|
||||
{
|
||||
public function testTheDateIsNormalisedToMidnightSoTheUniqueConstraintCannotBeSidestepped(): void
|
||||
{
|
||||
$booking = new Booking(
|
||||
new User('[email protected]', 'A'),
|
||||
new Resource(ResourceType::DESK, 'D1'),
|
||||
new \DateTimeImmutable('2026-09-13 14:37:11'),
|
||||
);
|
||||
|
||||
self::assertSame('2026-09-13 00:00:00', $booking->getDate()->format('Y-m-d H:i:s'));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user