public function testGetFirstChildNoChildren() { $xml = '<element></element>'; $element = new XmlElement($xml); $result = $element->getFirstChild(); $this->assertNull($result); }
public function testGetEmptyArrayValue() { $file = $this->getResource(XmlDataSourceTest::TEST_DATA_FILE); $dataSource = new XmlDataSource($file, $this->getPopulator()); // ** Assert type derivation for array... $xml = '<property name="test"><array></array></property>'; $element = new XmlElement($xml); // ** Confirm that the first child is not null, and does in fact exist... $firstChild = $element->getFirstChild(); $this->assertNotNull($firstChild); $this->assertEquals('array', $firstChild->getName()); // ** Process value from populator's getValue() method.. $value = $dataSource->getValue($element); $this->assertEquals(array(), $value); }