xref: /PHP-5.3/ext/soap/tests/bugs/bug41097.phpt (revision 610c7fbe)
1--TEST--
2Bug #41097 (ext/soap returning associative array as indexed without using WSDL)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7function test($soap, $array) {
8  $soap->test($array);
9  echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
10}
11
12
13$soap = new SoapClient(null, array('uri' => 'http://uri/', 'location' => 'test://', 'exceptions' => 0, 'trace' => 1));
14test($soap, array('Foo', 'Bar'));
15test($soap, array(5 => 'Foo', 10 => 'Bar'));
16test($soap, array('5' => 'Foo', '10' => 'Bar'));
17$soap->test(new SoapVar(array('Foo', 'Bar'), APACHE_MAP));
18echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
19$soap->test(new SoapVar(array('Foo', 'Bar'), SOAP_ENC_ARRAY));
20echo (strpos($soap->__getLastRequest(), ':Map"') != false)?"Map\n":"Array\n";
21?>
22--EXPECT--
23Array
24Map
25Map
26Map
27Array
28