1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 02:22:57 +01:00

Issue: Add failing test for guzzle/guzzle/#368.

This commit is contained in:
Stan Angeloff 2013-07-01 15:33:31 +03:00
parent 124e079dfd
commit 09cbdd73c8

View File

@ -25,6 +25,20 @@ class XmlVisitorTest extends AbstractResponseVisitorTest
$this->assertEquals(array('Bar' => 'test'), $result);
}
public function testBeforeMethodParsesXmlWithNamespace()
{
$visitor = new Visitor();
$command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand')
->setMethods(array('getResponse'))
->getMockForAbstractClass();
$command->expects($this->once())
->method('getResponse')
->will($this->returnValue(new Response(200, null, '<foo xmlns="urn:foo"><bar:Bar xmlns:bar="urn:bar">test</bar:Bar></foo>')));
$result = array();
$visitor->before($command, $result);
$this->assertEquals(array('Bar' => 'test'), $result);
}
public function testBeforeMethodParsesNestedXml()
{
$visitor = new Visitor();