2019-11-27 23:43:21 +01:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-11-27 23:43:21 +01:00
|
|
|
namespace Engelsystem\Test\Unit\Helpers\Schedule;
|
|
|
|
|
|
|
|
use Engelsystem\Helpers\Schedule\Event;
|
|
|
|
use Engelsystem\Helpers\Schedule\Room;
|
2021-12-28 14:43:23 +01:00
|
|
|
use Engelsystem\Helpers\Uuid;
|
2019-11-27 23:43:21 +01:00
|
|
|
use Engelsystem\Test\Unit\TestCase;
|
|
|
|
|
|
|
|
class RoomTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::__construct
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::getName
|
2021-12-28 14:43:23 +01:00
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::getEvents
|
2023-12-17 23:42:23 +01:00
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::getGuid
|
2019-11-27 23:43:21 +01:00
|
|
|
*/
|
2023-12-17 23:42:23 +01:00
|
|
|
public function testCreateDefault(): void
|
2019-11-27 23:43:21 +01:00
|
|
|
{
|
|
|
|
$room = new Room('Test');
|
|
|
|
$this->assertEquals('Test', $room->getName());
|
2021-12-28 14:43:23 +01:00
|
|
|
$this->assertEquals([], $room->getEvents());
|
2023-12-17 23:42:23 +01:00
|
|
|
$this->assertNull($room->getGuid());
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::__construct
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::getName
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::getEvents
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::setEvents
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Room::getGuid
|
|
|
|
*/
|
|
|
|
public function testCreate(): void
|
|
|
|
{
|
|
|
|
$uuid = Uuid::uuid();
|
2019-11-27 23:43:21 +01:00
|
|
|
$events = [$this->createMock(Event::class), $this->createMock(Event::class)];
|
|
|
|
$events2 = [$this->createMock(Event::class)];
|
2023-12-17 23:42:23 +01:00
|
|
|
$room = new Room('Test2', $uuid, $events);
|
2021-12-28 14:43:23 +01:00
|
|
|
$this->assertEquals($events, $room->getEvents());
|
2023-12-17 23:42:23 +01:00
|
|
|
$this->assertEquals($uuid, $room->getGuid());
|
2019-11-27 23:43:21 +01:00
|
|
|
|
2021-12-28 14:43:23 +01:00
|
|
|
$room->setEvents($events2);
|
|
|
|
$this->assertEquals($events2, $room->getEvents());
|
2019-11-27 23:43:21 +01:00
|
|
|
}
|
|
|
|
}
|