Skip to content

Commit

Permalink
Fix annoying bug with caseSensitive=false
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Apr 8, 2016
1 parent f1b9727 commit b13cbec
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/qtism/runtime/expressions/MapResponseProcessorTest.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<?php

use qtism\common\datatypes\Identifier;
require_once (dirname(__FILE__) . '/../../../QtiSmTestCase.php');

use qtism\common\datatypes\Identifier;
use qtism\common\datatypes\Integer;

use qtism\data\expressions\MapResponse;

use qtism\runtime\common\RecordContainer;

require_once (dirname(__FILE__) . '/../../../QtiSmTestCase.php');

use qtism\runtime\common\OutcomeVariable;
use qtism\common\enums\BaseType;
use qtism\runtime\common\ResponseVariable;
Expand Down Expand Up @@ -201,6 +197,12 @@ public function testMultipleCardinalityIdentifierToFloat() {
$state['RESPONSE'] = new MultipleContainer(BaseType::IDENTIFIER, array(new Identifier('choice7'), new Identifier('identifierX')));
$result = $mapResponseProcessor->process();
$this->assertEquals(-21.0, $result->getValue());

// Response is 'choice1', 'choice7'. As entries 'Choice1' and 'Choice7' are marked
// as case insensitive, they will be matched.
$state['RESPONSE'] = new MultipleContainer(BaseType::IDENTIFIER, array(new Identifier('choice7'), new Identifier('choice1')));
$result = $mapResponseProcessor->process();
$this->assertEquals(-18.0, $result->getValue());

// Empty state.
// An exception is raised because no RESPONSE variable found.
Expand Down

0 comments on commit b13cbec

Please sign in to comment.