/**
  * @dataProvider getEventsProvider
  */
 public function testGetEvents($begin, $end, array $expectedEvents)
 {
     foreach ($this->getSomeEvents() as $event) {
         $this->object->add($event);
     }
     $events = $this->object->getEvents($begin, $end);
     $this->assertSame(count($expectedEvents), count($events));
     foreach ($events as $i => $event) {
         $this->assertSame('event-' . $expectedEvents[$i], $events[$i]->getUid());
     }
 }
Exemple #2
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $basic1 = new Basic();
     $basic2 = new Basic();
     $this->object = new Manager(array('basic-1' => $basic1, 'basic-2' => $basic2));
     $basic1->add(new Event('event-1', new \DateTime('2012-01-01'), new \DateTime('2012-01-03')));
     $basic2->add(new Event('event-2', new \DateTime('2012-01-04'), new \DateTime('2012-01-05')));
 }