/** * Tests the debug method. * * It is expected that the `debug` method, * * * invokes the event dispatcher. * * @return void */ public function testDebug() { // set up mocks for the dispatcher and the generated event. $event_dispatcher = $this->getMock('sfEventDispatcher', array('notify')); $event = $this->getMock('sfEvent', array('getReturnValue'), array($this->fixture, 'system.debug', array('message' => 'body'))); // the event dispatcher's notify method will be invoken and return the // expected event $event_dispatcher->expects($this->once())->method('notify')->will($this->returnValue($event)); // we will let the event return true to test whether the return value // is actually returned $event->expects($this->once())->method('getReturnValue')->will($this->returnValue(true)); // test without setting the dispatcher ParserAbstract::$event_dispatcher = $event_dispatcher; $this->fixture->debug('body'); }
function testCalendarQuery() { $abstract = new AbstractMock(); $filters = array('name' => 'VCALENDAR', 'comp-filters' => array(array('name' => 'VEVENT', 'comp-filters' => array(), 'prop-filters' => array(), 'is-not-defined' => false, 'time-range' => null)), 'prop-filters' => array(), 'is-not-defined' => false, 'time-range' => null); $this->assertEquals(array('event1.ics'), $abstract->calendarQuery(1, $filters)); }