assertFalse($parser->load('foo')); // Minimal import $this->assertTrue($parser->load(file_get_contents(__DIR__ . '/Assets/schedule-minimal.xml'))); // Basic import $this->assertTrue($parser->load(file_get_contents(__DIR__ . '/Assets/schedule-basic.xml'))); // Extended import $this->assertTrue($parser->load(file_get_contents(__DIR__ . '/Assets/schedule-extended.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()); $this->assertEquals('https://foo.bar/baz/schedule/ipsum/recording.mp4', $event->getVideoDownloadUrl()); } }