bug41097.phpt 825 B

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