Esempio n. 1
0
 public function testAddEvent_SameDay()
 {
     $event1 = new SingleDayEvent();
     $event1->setDate(new \DateTime('2014-01-29'));
     $event1->setStartTime(new \DateTime('14:00'));
     $event1->setEndTime(new \DateTime('15:00'));
     $event2 = new SingleDayEvent();
     $event2->setDate(new \DateTime('2014-01-29'));
     $event2->setStartTime(new \DateTime('14:00'));
     $event2->setEndTime(new \DateTime('15:00'));
     $this->week->addEvent($event1);
     $this->week->addEvent($event2);
     $rows = $this->week->getRows();
     $this->assertEquals(2, count($rows));
 }
Esempio n. 2
0
 public function testDiaryItem()
 {
     $event = new SingleDayEvent();
     $event->setName('Test Event');
     $item = new DiaryItem();
     $item->setStartAt(new \DateTime('2014-02-01'));
     $item->setEndAt(new \DateTime('2014-02-05'));
     $item->setStartIndex(1);
     $item->setNumberOfDays(4);
     $item->setEvent($event);
     $this->assertEquals('1 February 2014', $item->getStartAt()->format('j F Y'));
     $this->assertEquals('5 February 2014', $item->getEndAt()->format('j F Y'));
     $this->assertEquals(1, $item->getStartIndex());
     $this->assertEquals(4, $item->getNumberOfDays());
     $this->assertEquals($event, $item->getEvent());
 }
Esempio n. 3
0
 public function testSingleDayEvent()
 {
     $event = new SingleDayEvent();
     $event->setDate(new \DateTime('2014-02-01'));
     $this->assertEquals('1 February 2014', $event->getDate()->format('j F Y'));
 }
Esempio n. 4
0
 public function createEventFromAudition(Audition $audition)
 {
     $event = new SingleDayEvent();
     $event->setName($audition->getShow()->getName());
     $event->setLink($this->router->generate('get_auditions') . '#auditions-' . $audition->getShow()->getId());
     $event->setDate($audition->getDate());
     $event->setStartTime($audition->getStartTime());
     $event->setEndTime($audition->getEndTime());
     $event->setVenue($audition->getLocation());
     return $event;
 }
Esempio n. 5
0
 public function testCanAccept_MultiDayClash()
 {
     $event1 = new MultiDayEvent();
     $event1->setStartDate(new \DateTime('2014-02-02'));
     $event1->setEndDate(new \DateTime('2014-02-04'));
     $event1->setStartTime(new \DateTime('14:00'));
     $event1->setEndTime(new \DateTime('15:00'));
     $this->row->addEvent($event1);
     $event2 = new SingleDayEvent();
     $event2->setDate(new \DateTime('2014-02-02'));
     $event2->setStartTime(new \DateTime('14:00'));
     $event2->setEndTime(new \DateTime('15:00'));
     $this->assertFalse($this->row->canAccept($event2));
 }