26 lines
640 B
PHP
26 lines
640 B
PHP
<?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'));
|
|
}
|
|
}
|