Ejemplo n.º 1
0
 public function testClone()
 {
     // value, default value and correct response must be independent after cloning.
     $responseVariable = new ResponseVariable('MYVAR', Cardinality::SINGLE, BaseType::INTEGER, new QtiInteger(25));
     $responseVariable->setDefaultValue(new QtiInteger(1));
     $responseVariable->setCorrectResponse(new QtiInteger(1337));
     $clone = clone $responseVariable;
     $this->assertNotSame($responseVariable->getValue(), $clone->getValue());
     $this->assertNotSame($responseVariable->getDefaultValue(), $clone->getDefaultValue());
     $this->assertNotSame($responseVariable->getCorrectResponse(), $clone->getCorrectResponse());
 }