public function testArrayHandling() { $objChangelog = new class_module_system_changelog(); $objOne = new dummyObject2(generateSystemid()); $objChangelog->readOldValues($objOne); $arrChanges = array(); $this->assertTrue(!$objChangelog->isObjectChanged($objOne, $arrChanges)); $this->assertTrue(count($arrChanges) == 0); $objOne->setArrValues(array("a", "c", "d")); $arrChanges = array(); $this->assertTrue($objChangelog->isObjectChanged($objOne, $arrChanges)); $this->assertTrue(count($arrChanges) == 1); $this->assertEquals($arrChanges[0]["property"], "arrValues"); $this->assertEquals($arrChanges[0]["oldvalue"], "b,c,d"); $this->assertEquals($arrChanges[0]["newvalue"], "a,c,d"); $objChangelog->readOldValues($objOne); $objOne->setArrValues(array("a", "d", "c")); $arrChanges = array(); $this->assertTrue(!$objChangelog->isObjectChanged($objOne, $arrChanges)); $this->assertTrue(count($arrChanges) == 0); }
/** * Method to invoke object initialization. * In nearly all cases, this is triggered by the framework itself. * @return void */ public final function initObject() { $this->initObjectInternal(); $this->internalInit(); //if given, read versioning information if ($this instanceof interface_versionable) { $objChangelog = new class_module_system_changelog(); $objChangelog->readOldValues($this); } }