From 42721e95726559b4a601240bb5b0fe4e5d755b2a Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 27 Nov 2019 23:43:21 +0100 Subject: Added Schedule parsing and replaced old Fahrplan importer Resolves #553 (Change Frab Import from xCal to XML) Resolves #538 (Feature Request: Multi Frab Import) --- tests/Unit/Helpers/Schedule/XmlParserTest.php | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/Unit/Helpers/Schedule/XmlParserTest.php (limited to 'tests/Unit/Helpers/Schedule/XmlParserTest.php') diff --git a/tests/Unit/Helpers/Schedule/XmlParserTest.php b/tests/Unit/Helpers/Schedule/XmlParserTest.php new file mode 100644 index 00000000..023e9c7d --- /dev/null +++ b/tests/Unit/Helpers/Schedule/XmlParserTest.php @@ -0,0 +1,54 @@ +assertFalse($parser->load('foo')); + $this->assertTrue($parser->load(file_get_contents(__DIR__ . '/Assets/schedule.xml'))); + + $schedule = $parser->getSchedule(); + $this->assertEquals('Some version string', $schedule->getVersion()); + $this->assertEquals('Test Event', $schedule->getConference()->getTitle()); + + /** @var Room $room */ + $room = Arr::first($schedule->getRooms()); + $this->assertEquals('Rooming', $room->getName()); + + /** @var Day $day */ + $day = Arr::first($schedule->getDay()); + $this->assertEquals('2042-01-01', $day->getDate()); + $this->assertEquals(1, $day->getIndex()); + + /** @var Room $room */ + $room = Arr::first($day->getRoom()); + /** @var Event $event */ + $event = Arr::first($room->getEvent()); + + $this->assertEquals('Foo Bar Test', $event->getTitle()); + $this->assertEquals('WTFPL', $event->getRecording()); + $this->assertEquals('de', $event->getLanguage()); + $this->assertEquals('12:30', $event->getStart()); + $this->assertEquals([1234 => 'Some Person'], $event->getPersons()); + } +} -- cgit v1.2.3-70-g09d2