Skip to content

Commit af30ba4

Browse files
committed
Working on better code coverage
Added a new test that gets us up to 80% coverage. Still a ways to go.
1 parent 75acba3 commit af30ba4

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tests/simplexml_dump_Test.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,27 @@ public function testDumpWithNS()
5757
$return = simplexml_dump($this->simpleXML_NS, true);
5858
$this->assertEquals($this->expected_NS, $return);
5959
}
60+
61+
public function testDumpWithSingleNodeWithAttributesAndNS()
62+
{
63+
$xml = '<parent xmlns:ns="ns"><ns:child ns:foo="bar" /></parent>';
64+
$sxml = simplexml_load_string($xml);
65+
66+
$return = simplexml_dump($sxml->children('ns', true)->child->attributes('ns'), true);
67+
68+
$expected = "SimpleXML object (1 item)
69+
[
70+
Attribute {
71+
Namespace: 'ns'
72+
Namespace Alias: 'ns'
73+
Name: 'foo'
74+
Value: 'bar'
75+
}
76+
]
77+
";
78+
79+
$this->assertEquals($expected, $return);
80+
}
6081
}
6182

6283
?>

0 commit comments

Comments
 (0)