예제 #1
0
파일: Action.php 프로젝트: alfmel/cougar
 /**
  * Makes sure the parameter list and return value are cloned.
  */
 public function __clone()
 {
     Arrays::cloneObjects($this->parameters);
     $this->returnValue = clone $this->returnValue;
 }
예제 #2
0
파일: Component.php 프로젝트: alfmel/cougar
 /**
  * Makes sure the resource list is cloned.
  */
 public function __clone()
 {
     Arrays::cloneObjects($this->resources);
 }
예제 #3
0
 /**
  * @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]);
 }
예제 #4
0
파일: Resource.php 프로젝트: alfmel/cougar
 /**
  * Makes sure the action list is cloned.
  */
 public function __clone()
 {
     Arrays::cloneObjects($this->actions);
 }