24 'namespaces' =>
'http://foo.com'
27 'parameters' => array(
28 'Foo' => array(
'location' =>
'xml',
'type' =>
'string'),
29 'Baz' => array(
'location' =>
'xml',
'type' =>
'string')
32 array(
'Foo' =>
'test',
'Baz' =>
'bar'),
33 '<test xmlns="http://foo.com"><Foo>test</Foo><Baz>bar</Baz></test>'
36 array(array(
'parameters' => array(
'Foo' => array(
'location' =>
'xml',
'type' =>
'string'))), array(),
''),
45 'parameters' => array(
46 'Foo' => array(
'location' =>
'xml',
'type' =>
'string',
'data' => array(
'xmlAttribute' =>
true))
49 array(
'Foo' =>
'test',
'Baz' =>
'bar'),
55 'parameters' => array(
56 'Foo' => array(
'location' =>
'xml',
'type' =>
'string'),
67 array(
'Foo' =>
'test',
'Baz' => array(1, 2)),
68 '<Request><Foo>test</Foo><Baz><Bar>1</Bar><Bar>2</Bar></Baz></Request>'
73 'parameters' => array(
74 'Foo' => array(
'location' =>
'xml',
'type' =>
'string'),
78 'properties' => array(
79 'Bar' => array(
'type' =>
'string'),
85 array(
'Foo' =>
'test',
'Baz' => array(
'Bar' =>
'abc',
'Bam' =>
'foo')),
86 '<Request><Foo>test</Foo><Baz><Bar>abc</Bar><Bam>foo</Bam></Baz></Request>'
91 'parameters' => array(
98 'properties' => array(
'A' => array(),
'B' => array())
103 array(
'Baz' => array(
104 array(
'A' =>
'1',
'B' =>
'2'),
105 array(
'A' =>
'3',
'B' =>
'4')
107 '<Request><Baz><Bar><A>1</A><B>2</B></Bar><Bar><A>3</A><B>4</B></Bar></Baz></Request>'
112 'parameters' => array(
113 'Foo' => array(
'location' =>
'xml',
'type' =>
'string'),
117 'properties' => array(
118 'Bar' => array(
'type' =>
'string',
'data' => array(
'xmlAttribute' =>
true)),
124 array(
'Foo' =>
'test',
'Baz' => array(
'Bar' =>
'abc',
'Bam' =>
'foo')),
125 '<Request><Foo>test</Foo><Baz Bar="abc"><Bam>foo</Bam></Baz></Request>'
130 'parameters' => array(
131 'Foo' => array(
'location' =>
'xml',
'type' =>
'string'),
135 'properties' => array(
136 'Bar' => array(
'type' =>
'string',
'data' => array(
'xmlAttribute' =>
true)),
142 array(
'Foo' =>
'test',
'Baz' => array(
'Bam' =>
'foo',
'Bar' =>
'abc')),
143 '<Request><Foo>test</Foo><Baz Bar="abc"><Bam>foo</Bam></Baz></Request>'
148 'parameters' => array(
153 'xmlNamespace' =>
'http://foo.com'
158 array(
'Foo' =>
'test'),
159 '<Request><Foo xmlns="http://foo.com">test</Foo></Request>'
164 'parameters' => array(
168 'properties' => array(
171 'sentAs' =>
'xsi:baz',
173 'xmlNamespace' =>
'http://foo.com',
174 'xmlAttribute' =>
true
181 array(
'Wrap' => array(
184 '<Request><Wrap xsi:baz="test" xmlns:xsi="http://foo.com"/></Request>'
189 'parameters' => array(
193 'properties' => array(
196 'sentAs' =>
'xsi:Foo',
198 'xmlNamespace' =>
'http://foobar.com'
205 array(
'Wrap' => array(
208 '<Request><Wrap><xsi:Foo xmlns:xsi="http://foobar.com">test</xsi:Foo></Wrap></Request>'
212 'parameters' => array(
217 'xmlNamespace' =>
'http://foo.com'
222 array(
'Foo' =>
'<h1>This is a title</h1>'),
223 '<Request><Foo xmlns="http://foo.com"><![CDATA[<h1>This is a title</h1>]]></Foo></Request>'
228 'parameters' => array(
231 'data' => array(
'xmlFlattened' =>
true),
236 'properties' => array(
244 'data' => array(
'xmlFlattened' =>
true),
255 array(
'A' =>
'1',
'B' =>
'2'),
256 array(
'A' =>
'3',
'B' =>
'4')
258 'Boos' => array(
'test',
'123')
260 '<Request><Bar><A>1</A><B>2</B></Bar><Bar><A>3</A><B>4</B></Bar><Boo>test</Boo><Boo>123</Boo></Request>'
265 'parameters' => array(
269 'properties' => array(
272 'data' => array(
'xmlFlattened' =>
true),
276 'properties' => array(
289 array(
'A' =>
'1',
'B' =>
'2'),
290 array(
'A' =>
'3',
'B' =>
'4')
294 '<Request><Delete><Item><A>1</A><B>2</B></Item><Item><A>3</A><B>4</B></Item></Delete></Request>'
305 $command = $this->getMockBuilder(
'Guzzle\Service\Command\OperationCommand')
306 ->setConstructorArgs(array($input, $operation))
307 ->getMockForAbstractClass();
308 $command->setClient(
new Client(
'http://www.test.com/some/path.php'));
310 if (!empty($input)) {
311 $this->assertEquals(
'application/xml', (
string)
$request->getHeader(
'Content-Type'));
313 $this->assertNull(
$request->getHeader(
'Content-Type'));
315 $body = str_replace(array(
"\n",
"<?xml version=\"1.0\"?>"),
'', (
string)
$request->getBody());
316 $this->assertEquals($xml, $body);
325 'namespaces' => array(
326 'xsi' =>
'http://foo.com'
330 'parameters' => array(
331 'Foo' => array(
'location' =>
'xml',
'type' =>
'string'),
332 'Baz' => array(
'location' =>
'xml',
'type' =>
'string')
336 $command = $this->getMockBuilder(
'Guzzle\Service\Command\OperationCommand')
337 ->setConstructorArgs(array(array(
341 ->getMockForAbstractClass();
345 $this->assertEquals(
'application/xml', (
string)
$request->getHeader(
'Content-Type'));
347 '<?xml version="1.0"?>' .
"\n"
348 .
'<test xmlns:xsi="http://foo.com"><Foo>test</Foo><Baz>bar</Baz></test>' .
"\n",
356 $visitor->setContentTypeHeader(
'application/foo');
357 $this->assertEquals(
'application/foo', $this->readAttribute($visitor,
'contentType'));
368 'properties' => array(
373 'items' => array(
'type' =>
'string',
'sentAs' =>
'Node')
382 'namespaces' => array(
389 $value = array(
'Nodes' => array(
'foo',
'baz'));
390 $this->assertTrue($this->validator->validate(
$param, $value));
392 $visitor->after($this->command,
$request);
395 "<?xml version=\"1.0\"?>\n"
396 .
"<Test xmlns=\"https://foo/\"><Out><Nodes><Node>foo</Node><Node>baz</Node></Nodes></Out></Test>\n",
407 'namespaces' => array(
408 'xsi' =>
'http://foo.com',
409 'foo' =>
'http://foobar.com'
413 'parameters' => array(
414 'Foo' => array(
'location' =>
'xml',
'type' =>
'string')
418 $command = $this->getMockBuilder(
'Guzzle\Service\Command\OperationCommand')
419 ->setConstructorArgs(array(array(
422 ->getMockForAbstractClass();
426 $this->assertEquals(
'application/xml', (
string)
$request->getHeader(
'Content-Type'));
428 '<?xml version="1.0"?>' .
"\n"
429 .
'<Hi xmlns:xsi="http://foo.com" xmlns:foo="http://foobar.com"><Foo>test</Foo></Hi>' .
"\n",
437 'parameters' => array(
441 'filters' => array(
'strtoupper')
446 'properties' => array(
448 'filters' => array(
'strtoupper')
455 $command = $this->getMockBuilder(
'Guzzle\Service\Command\OperationCommand')
456 ->setConstructorArgs(array(array(
462 ->getMockForAbstractClass();
467 '<?xml version="1.0"?>' .
"\n"
468 .
'<Request><Foo>TEST</Foo><Bar><Baz>ABC</Baz></Bar></Request>' .
"\n",
476 'parameters' => array(
484 'properties' => array(
498 $command = $this->getMockBuilder(
'Guzzle\Service\Command\OperationCommand')
499 ->setConstructorArgs(array(array(
507 ->getMockForAbstractClass();
512 '<?xml version="1.0"?>' .
"\n"
513 .
'<Request><Bar><Bam>test</Bam></Bar></Request>' .
"\n",
522 'xmlEncoding' =>
'UTF-8'
524 'parameters' => array(
525 'Foo' => array(
'location' =>
'xml')
528 $command = $this->getMockBuilder(
'Guzzle\Service\Command\OperationCommand')
529 ->setConstructorArgs(array(array(
'Foo' =>
'test'), $operation))
530 ->getMockForAbstractClass();
534 '<?xml version="1.0" encoding="UTF-8"?>' .
"\n"
535 .
'<Request><Foo>test</Foo></Request>' .
"\n",
543 'httpMethod' =>
'POST',
544 'data' => array(
'xmlAllowEmpty' =>
true),
545 'parameters' => array(
'Foo' => array(
'location' =>
'xml'))
547 $command = $this->getMockBuilder(
'Guzzle\Service\Command\OperationCommand')
548 ->setConstructorArgs(array(array(), $operation))
549 ->getMockForAbstractClass();
553 '<?xml version="1.0"?>' .
"\n"
554 .
'<Request/>' .
"\n",