schema085.phpt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. SOAP XML Schema 85: Extension of complex type (elements order)
  3. --EXTENSIONS--
  4. soap
  5. xml
  6. --FILE--
  7. <?php
  8. include "test_schema.inc";
  9. $schema = <<<EOF
  10. <complexType name="testType2">
  11. <sequence>
  12. <element name="int" type="int"/>
  13. </sequence>
  14. </complexType>
  15. <complexType name="testType">
  16. <complexContent>
  17. <extension base="tns:testType2">
  18. <sequence>
  19. <element name="int2" type="int"/>
  20. </sequence>
  21. </extension>
  22. </complexContent>
  23. </complexType>
  24. EOF;
  25. class A {
  26. public $int = 1;
  27. }
  28. class B extends A {
  29. public $int2 = 2;
  30. }
  31. test_schema($schema,'type="tns:testType"',new B());
  32. echo "ok";
  33. ?>
  34. --EXPECTF--
  35. <?xml version="1.0" encoding="UTF-8"?>
  36. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType"><int xsi:type="xsd:int">1</int><int2 xsi:type="xsd:int">2</int2></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
  37. object(stdClass)#%d (2) {
  38. ["int"]=>
  39. int(1)
  40. ["int2"]=>
  41. int(2)
  42. }
  43. ok