$xmlFile = '<?xml version="1.0" encoding="iso-8859-1" ?>' . "\n\n<CaseType>\n";
$xmlFile .= "<name>{$name}</name>\n";
+ if (array_key_exists('forkable', $definition)) {
+ $xmlFile .= "<forkable>" . ((int) $definition['forkable']) . "</forkable>\n";
+ }
+
if (isset($definition['activityTypes'])) {
$xmlFile .= "<ActivityTypes>\n";
foreach ($definition['activityTypes'] as $values) {
// build PHP array based on definition
$definition = array();
+ if (isset($xml->forkable)) {
+ $definition['forkable'] = (int) $xml->forkable;
+ }
+
// set activity types
if (isset($xml->ActivityTypes)) {
$definition['activityTypes'] = array();
',
);
+ $fixtures['forkable-0'] = array(
+ 'json' => json_encode(array(
+ 'forkable' => 0,
+ )),
+ 'xml' => '<?xml version="1.0" encoding="iso-8859-1" ?>
+<CaseType>
+ <name>Housing Support</name>
+ <forkable>0</forkable>
+</CaseType>
+ ',
+ );
+
+ $fixtures['forkable-1'] = array(
+ 'json' => json_encode(array(
+ 'forkable' => 1,
+ )),
+ 'xml' => '<?xml version="1.0" encoding="iso-8859-1" ?>
+<CaseType>
+ <name>Housing Support</name>
+ <forkable>1</forkable>
+</CaseType>
+ ',
+ );
+
$cases = array();
foreach (array(
'empty-defn',
'empty-lists',
'one-item-in-each',
'two-items-in-each',
+ 'forkable-0',
+ 'forkable-1',
) as $key) {
$cases[] = array($key, $fixtures[$key]['json'], $fixtures[$key]['xml']);
}