/** * Makes sure the parameter list and return value are cloned. */ public function __clone() { Arrays::cloneObjects($this->parameters); $this->returnValue = clone $this->returnValue; }
/** * Makes sure the resource list is cloned. */ public function __clone() { Arrays::cloneObjects($this->resources); }
/** * @covers \Cougar\Util\Arrays::cloneObjects */ public function testCloneObjectsMixedArray() { $object1 = new stdClass(); $object1->value = "Object 1"; $object2 = new stdClass(); $object2->value = "Object 2"; $objects = array($object1, $object2, "stuff"); Arrays::cloneObjects($objects); $objects[0]->value = "Cloned Object 1"; $objects[1]->value = "Cloned Object 2"; $this->assertNotEquals($object1->value, $objects[0]->value); $this->assertNotEquals($object2->value, $objects[1]->value); $this->assertEquals("stuff", $objects[2]); }
/** * Makes sure the action list is cloned. */ public function __clone() { Arrays::cloneObjects($this->actions); }