Ejemplo n.º 1
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')));
 }
Ejemplo n.º 2
0
 /**
  * @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());
     }
 }
Ejemplo n.º 3
0
 public function testGetIterator()
 {
     $this->assertInstanceOf('Iterator', $this->object->getIterator());
 }
Ejemplo n.º 4
0
 public function testNoErrorWhenNoEvents()
 {
     $this->assertSame(array(), $this->object->getEvents(new \DateTime('2013-06-01'), new \DateTime('2013-07-01')));
 }