Files
myep/tests/Form/Model/BookingDtoTest.php
T

32 lines
895 B
PHP

<?php
declare(strict_types=1);
namespace App\Tests\Form\Model;
use App\BusProNet\Model\Travel;
use App\Form\Model\BookingDto;
use PHPUnit\Framework\TestCase;
/**
* Tests for BookingDto validation and business logic.
*
* Email uniqueness validation tests have been moved to ParticipantEditDtoTest
* as part of the refactoring to use the wrapper DTO pattern.
*/
class BookingDtoTest extends TestCase
{
public function testBookingDtoCanBeInstantiated(): void
{
$travel = new Travel();
$travel->dateFrom = new \DateTimeImmutable('2025-06-01');
$travel->dateTo = new \DateTimeImmutable('2025-06-08');
$bookingDto = new BookingDto($travel, 1);
$this->assertInstanceOf(BookingDto::class, $bookingDto);
$this->assertSame($travel, $bookingDto->travel);
$this->assertSame(BookingDto::MODE_CREATE, $bookingDto->getMode());
}
}