/** * Test that you can pass in name/value parts, property objects, or a combination, and that * the name portion is case insensitive */ public function testCalendarInitializeAcceptsMixedArray() { // name/value pairs $properties = array('prodid' => '// Test //', 'version' => '3.1'); $calendar = new qCal_Component_Vcalendar($properties); $prodid = $calendar->getProperty('prodid'); $this->assertEqual($prodid[0]->getValue(), '// Test //'); $version = $calendar->getProperty('version'); $this->assertEqual($version[0]->getValue(), '3.1'); // property objects $properties = array(new qCal_Property_Version('4.0'), new qCal_Property_Prodid('// Test //')); $calendar = new qCal_Component_Vcalendar($properties); $prodid = $calendar->getProperty('prodid'); $this->assertEqual($prodid[0]->getValue(), '// Test //'); $version = $calendar->getProperty('version'); $this->assertEqual($version[0]->getValue(), '4.0'); // combination of property objects and name/value $properties = array(new qCal_Property_Version('4.0'), 'prodid' => '// Test //'); $calendar = new qCal_Component_Vcalendar($properties); $prodid = $calendar->getProperty('prodid'); $this->assertEqual($prodid[0]->getValue(), '// Test //'); $version = $calendar->getProperty('version'); $this->assertEqual($version[0]->getValue(), '4.0'); // @todo what happens if the same property is passed in multiple times, and that isn't allowed? }