Permalink
Browse files

fixed xml driver

  • Loading branch information...
1 parent 06799e5 commit c084e8abc1308293eb19036925e029a22c829a7a @mitrae mitrae committed Jun 22, 2012
@@ -66,7 +66,7 @@ public function readExtendedMetadata($meta, array &$config) {
/** @var \SimpleXmlElement $data */
$data = $mapping->translatable;
if ($this->_isAttributeSet($data, 'fallback')) {
- $config['fallback'][$field] = $this->_getAttribute($data, 'fallback');
+ $config['fallback'][$field] = 'true' == $this->_getAttribute($data, 'fallback') ? true : false;
}
}
}
@@ -67,5 +67,9 @@ public function testTranslatableMetadata()
$this->assertCount(4, $config['fields']);
$this->assertTrue(in_array('title', $config['fields']));
$this->assertTrue(in_array('content', $config['fields']));
+ $this->assertTrue(in_array('author', $config['fields']));
+ $this->assertTrue(in_array('views', $config['fields']));
+ $this->assertTrue($config['fallback']['author']);
+ $this->assertFalse($config['fallback']['views']);
}
}

0 comments on commit c084e8a

Please sign in to comment.