getInput() ); $result = $gen->getResult(); $expected = array( '20110101T120000Z/20110101T130000Z', '20110101T130000Z/20110101T140000Z', '20110101T180000Z/20110101T190000Z', '20110101T190000Z/20110101T200000Z', '20110102T000000Z/20110103T000000Z', '20110101T210000Z/20110101T220000Z', '20110103T010000Z/20110103T020000Z', '20110103T030000Z/20110103T040000Z', '20110103T040000Z/20110103T050000Z', '20110103T050000Z/20110103T060000Z', '20110101T220000Z/20110101T230000Z', '20110101T230000Z/20110102T000000Z', ); foreach($result->VFREEBUSY->FREEBUSY as $fb) { $this->assertContains((string)$fb, $expected); $k = array_search((string)$fb, $expected); unset($expected[$k]); } if (count($expected)>0) { $this->fail('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->value); } /** * @expectedException InvalidArgumentException */ function testInvalidArg() { $gen = new FreeBusyGenerator( new \DateTime('2012-01-01'), new \DateTime('2012-12-31'), new \StdClass() ); } }