public function testMapWithMergableInteractionType()
 {
     $componentCollection = $this->buildComponentCollectionWithMergableInteractionTypes();
     $result = $this->mergedItemBuilder->map('testAssessmentItemIdentifier', ItemBodyBuilder::buildItemBody($componentCollection), $componentCollection);
     $this->assertTrue($result);
     $this->assertCount(1, LogService::read());
     $questions = $this->mergedItemBuilder->getQuestions();
     $this->assertCount(1, $questions);
     $this->assertInstanceOf('LearnosityQti\\Entities\\Question', $questions[0]);
     $q = $questions[0];
     $this->assertEquals('testAssessmentItemIdentifier_testTextEntryInteractionOne_testTextEntryInteractionTwo', $q->get_reference());
     $this->assertEquals('clozetext', $q->get_type());
     $qData = $q->get_data();
     $this->assertEquals('clozetext', $qData->get_type());
     $this->assertTrue(substr_count($qData->get_template(), '{{response}}') === 2);
 }
 public function testMapWithRegularInteractionType()
 {
     $componentCollection = $this->buildComponentCollectionWithRegularInteractionTypes();
     $result = $this->regularItemBuilder->map('testAssessmentItemIdentifier', ItemBodyBuilder::buildItemBody($componentCollection), $componentCollection, $this->buildResponseDeclaration());
     $this->assertTrue($result);
     $questions = $this->regularItemBuilder->getQuestions();
     $this->assertCount(2, $questions);
     $this->assertEquals('<p>The Matrix movie is starring <span class="learnosity-response question-testAssessmentItemIdentifier_testTextEntryInteractionIdentifier"></span></p><span class="learnosity-response question-testAssessmentItemIdentifier_testChoiceInteractionIdentifier"></span>', $this->regularItemBuilder->getItem()->get_content());
     $this->assertTrue(isset($questions[0]));
     $this->assertTrue(isset($questions[1]));
     $q1 = $questions[0];
     $this->assertEquals('testAssessmentItemIdentifier_testChoiceInteractionIdentifier', $q1->get_reference());
     $this->assertEquals('mcq', $q1->get_type());
     $this->assertInstanceOf('LearnosityQti\\Entities\\QuestionTypes\\mcq', $q1->get_data());
     $q2 = $questions[1];
     $this->assertEquals('testAssessmentItemIdentifier_testTextEntryInteractionIdentifier', $q2->get_reference());
     $this->assertEquals('clozetext', $q2->get_type());
     $this->assertInstanceOf('LearnosityQti\\Entities\\QuestionTypes\\clozetext', $q2->get_data());
 }