public function testModel() { $myItem = new Item(); $myItem->setAttribute('title', 'My Coolest Item'); $myItem->getBody()->edit('sth'); $myInteraction = new ChoiceInteraction(); $myInteraction->getPrompt()->edit('Prompt you'); $myChoice1 = $myInteraction->createChoice(array('fixed' => true), 'This is correct'); $myChoice2 = $myInteraction->createChoice(array('fixed' => true), 'This is not correct'); $this->assertInstanceOf('\\oat\\taoQtiItem\\model\\qti\\choice\\SimpleChoice', $myChoice2); $this->assertEquals(count($myInteraction->getChoices()), 2); $myChoice1->setContent('answer #1'); $myChoice2->setContent('answer #2'); $myInteraction->removeChoice($myChoice1); $this->assertEquals(count($myInteraction->getChoices()), 1); $myItem->addInteraction($myInteraction, "Adding my interaction here {$myInteraction->getPlaceholder()}. And not there."); $this->assertNotNull($myInteraction->getRelatedItem()); $this->assertEquals($myInteraction->getRelatedItem()->getSerial(), $myItem->getSerial()); $myResponse = new ResponseDeclaration(); $myItem->addResponse($myResponse); $this->assertNotNull($myResponse->getRelatedItem()); $this->assertEquals($myResponse->getRelatedItem()->getSerial(), $myItem->getSerial()); $myItem->removeResponse($myResponse); $responses = $myItem->getResponses(); $this->assertTrue(empty($responses)); }