public function testGetEvents() { $em = $this->getMock('CalendR\\Event\\Manager'); $period = $this->getMock('CalendR\\Period\\PeriodInterface'); $events = array($this->getMock('CalendR\\Event\\EventInterface')); $calendar = new Calendar(); $calendar->setEventManager($em); $em->expects($this->once())->method('find')->with($period, array())->will($this->returnValue($events)); $this->assertSame($events, $calendar->getEvents($period, array())); }