/** * @param int $uid * @param string $begin * @param string $end * @param array $speakerIds * @param bool $expected * * @test * @dataProvider collidingSessionsAreDeterminedDataProvider */ public function collidingSessionsAreDetermined($uid, $begin, $end, array $speakerIds, $exclude, $expected) { $beginDateTime = \DateTime::createFromFormat(DATE_ISO8601, $begin); $endDateTime = \DateTime::createFromFormat(DATE_ISO8601, $end); $session = new AnySession(); $session->_setProperty('uid', $uid); $session->setBegin($beginDateTime); $session->setEnd($endDateTime); foreach ($speakerIds as $speakerId) { $speaker = new FrontendUser(); $speaker->_setProperty('uid', $speakerId); $session->addSpeaker($speaker); } $result = $this->subject->getCollidingSessions($session, $exclude); $this->assertEquals($expected, is_array($result) ? count($result) : $result); }