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\Conference;
|
2023-12-17 23:42:23 +01:00
|
|
|
use Engelsystem\Helpers\Schedule\ConferenceColor;
|
|
|
|
use Engelsystem\Helpers\Schedule\ConferenceTrack;
|
2019-11-27 23:43:21 +01:00
|
|
|
use Engelsystem\Test\Unit\TestCase;
|
|
|
|
|
|
|
|
class ConferenceTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::__construct
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTitle
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getAcronym
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getStart
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getEnd
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getDays
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTimeslotDuration
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTimeslotDurationSeconds
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getBaseUrl
|
2023-12-17 23:42:23 +01:00
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getLogo
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getUrl
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTimeZoneName
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getColor
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTracks
|
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
|
|
|
{
|
|
|
|
$conference = new Conference('Doing stuff', 'DS');
|
|
|
|
$this->assertEquals('Doing stuff', $conference->getTitle());
|
|
|
|
$this->assertEquals('DS', $conference->getAcronym());
|
|
|
|
$this->assertNull($conference->getStart());
|
|
|
|
$this->assertNull($conference->getEnd());
|
|
|
|
$this->assertNull($conference->getDays());
|
|
|
|
$this->assertNull($conference->getTimeslotDuration());
|
|
|
|
$this->assertNull($conference->getTimeslotDurationSeconds());
|
|
|
|
$this->assertNull($conference->getBaseUrl());
|
2023-12-17 23:42:23 +01:00
|
|
|
$this->assertNull($conference->getLogo());
|
|
|
|
$this->assertNull($conference->getUrl());
|
|
|
|
$this->assertNull($conference->getTimeZoneName());
|
|
|
|
$this->assertNull($conference->getColor());
|
|
|
|
$this->assertEmpty($conference->getTracks());
|
|
|
|
}
|
2019-11-27 23:43:21 +01:00
|
|
|
|
2023-12-17 23:42:23 +01:00
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::__construct
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTitle
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getAcronym
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getStart
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getEnd
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getDays
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTimeslotDuration
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTimeslotDurationSeconds
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getBaseUrl
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getLogo
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getUrl
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTimeZoneName
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getColor
|
|
|
|
* @covers \Engelsystem\Helpers\Schedule\Conference::getTracks
|
|
|
|
*/
|
|
|
|
public function testCreate(): void
|
|
|
|
{
|
2019-11-27 23:43:21 +01:00
|
|
|
$conference = new Conference(
|
|
|
|
'Doing stuff',
|
|
|
|
'DS',
|
|
|
|
'2042-01-01',
|
|
|
|
'2042-01-10',
|
|
|
|
10,
|
|
|
|
'00:10',
|
2023-12-17 23:42:23 +01:00
|
|
|
'https://foo.bar/schedule',
|
|
|
|
'https://foo.bar/logo.png',
|
|
|
|
'https://foo.bar',
|
|
|
|
'Europe/Berlin',
|
|
|
|
new ConferenceColor('#ffffff'),
|
|
|
|
[new ConferenceTrack('Test')]
|
2019-11-27 23:43:21 +01:00
|
|
|
);
|
2023-12-17 23:42:23 +01:00
|
|
|
$this->assertEquals('Doing stuff', $conference->getTitle());
|
|
|
|
$this->assertEquals('DS', $conference->getAcronym());
|
2019-11-27 23:43:21 +01:00
|
|
|
$this->assertEquals('2042-01-01', $conference->getStart());
|
|
|
|
$this->assertEquals('2042-01-10', $conference->getEnd());
|
|
|
|
$this->assertEquals(10, $conference->getDays());
|
|
|
|
$this->assertEquals('00:10', $conference->getTimeslotDuration());
|
|
|
|
$this->assertEquals(60 * 10, $conference->getTimeslotDurationSeconds());
|
|
|
|
$this->assertEquals('https://foo.bar/schedule', $conference->getBaseUrl());
|
2023-12-17 23:42:23 +01:00
|
|
|
$this->assertEquals('https://foo.bar/logo.png', $conference->getLogo());
|
|
|
|
$this->assertEquals('https://foo.bar', $conference->getUrl());
|
|
|
|
$this->assertEquals('Europe/Berlin', $conference->getTimeZoneName());
|
|
|
|
$this->assertNotNull($conference->getColor());
|
|
|
|
$this->assertEquals('#ffffff', $conference->getColor()->getPrimary());
|
|
|
|
$this->assertNotNull($conference->getTracks());
|
|
|
|
$this->assertEquals('Test', $conference->getTracks()[0]->getName());
|
2019-11-27 23:43:21 +01:00
|
|
|
}
|
|
|
|
}
|