Ejemplo n.º 1
0
 /**
  * copy an object using the copy constructor and check with them changing 
  * values of the original and the copy
  */
 function testCopyConstructor()
 {
     echo "testing copy constructor ";
     $color_a = new QColor(5, 3, 7);
     $color_b = new QColor($color_a);
     $this->assertEquals(7, $color_a->blue());
     $this->assertEquals(7, $color_b->blue());
     echo "passed\n";
     echo "testing changing the value at the copy ";
     $color_b->setBlue(24);
     $this->assertEquals(7, $color_a->blue());
     $this->assertEquals(24, $color_b->blue());
     echo "passed\n";
     echo "testing destroying the original ";
     $color_a->__destruct();
     unset($color_a);
     $this->assertEquals(24, $color_b->blue());
     echo "passed\n";
 }