Example #1
0
 public function testAllowsXmlEncoding()
 {
     $location = new XmlLocation('xml');
     $operation = new Operation(['data' => ['xmlEncoding' => 'UTF-8']], new Description([]));
     $command = $this->getCommand($operation);
     $request = new Request('POST', 'http://httbin.org');
     $param = new Parameter(['name' => 'foo']);
     $command['foo'] = 'bar';
     $location->visit($command, $request, $param, []);
     $location->after($command, $request, $operation, []);
     $xml = (string) $request->getBody();
     $this->assertEquals('<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<Request><foo>bar</foo></Request>' . "\n", $xml);
 }