getResult(); $expected = (array)$expected; $freebusy = $result->VFREEBUSY->select('FREEBUSY'); foreach($freebusy as $fb) { $this->assertContains((string)$fb, $expected, "$fb did not appear in our list of expected freebusy strings. This is concerning!"); $k = array_search((string)$fb, $expected); unset($expected[$k]); } $this->assertTrue( count($expected) === 0, 'There were elements in the expected array that were not found in the output: ' . "\n" . print_r($expected,true) . "\n" . $result->serialize() ); } function testGeneratorBaseObject() { $obj = new Component\VCalendar(); $obj->METHOD = 'PUBLISH'; $gen = new FreeBusyGenerator(); $gen->setObjects(array()); $gen->setBaseObject($obj); $result = $gen->getResult(); $this->assertEquals('PUBLISH', $result->METHOD->getValue()); } /** * @expectedException InvalidArgumentException */ function testInvalidArg() { $gen = new FreeBusyGenerator( new \DateTime('2012-01-01'), new \DateTime('2012-12-31'), new \StdClass() ); } }