Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Sep 23, 2016
2 parents bceda9e + 2f9aefb commit 83103f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/qtism/runtime/pci/json/Marshaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected function marshallUnit($unit)
$jsonEntry = array();
$jsonEntry['name'] = $k;

if (isset($data['base']) === true || $data['base'] === null) {
if (array_key_exists('base', $data) === true) {
// Primitive base type.
$jsonEntry['base'] = $data['base'];
} else {
Expand Down
5 changes: 5 additions & 0 deletions test/qtismtest/runtime/pci/json/JsonMarshallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ public function marshallRecordProvider() {
$json = json_encode(array('record' => array(array('name' => 'numeric', 'base' => array('float' => 1337.1337)), array('name' => 'null', 'base' => null), array('name' => 'coordinates', 'base' => array('point' => array(10, 20))))));
$returnValue[] = array($record, $json);

// nested list record.
$record = new RecordContainer(array('nested' => new MultipleContainer(BaseType::INTEGER, array(new QtiInteger(1)))));
$json = json_encode(array('record' => array(array('name' => 'nested', 'list' => array('integer' => array(1))))));
$returnValue[] = array($record, $json);

return $returnValue;
}

Expand Down

0 comments on commit 83103f9

Please sign in to comment.