schema085.phpt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. SOAP XML Schema 85: Extension of complex type (elements order)
  3. --SKIPIF--
  4. <?php require_once('skipif.inc'); ?>
  5. --FILE--
  6. <?php
  7. include "test_schema.inc";
  8. $schema = <<<EOF
  9. <complexType name="testType2">
  10. <sequence>
  11. <element name="int" type="int"/>
  12. </sequence>
  13. </complexType>
  14. <complexType name="testType">
  15. <complexContent>
  16. <extension base="tns:testType2">
  17. <sequence>
  18. <element name="int2" type="int"/>
  19. </sequence>
  20. </extension>
  21. </complexContent>
  22. </complexType>
  23. EOF;
  24. class A {
  25. public $int = 1;
  26. }
  27. class B extends A {
  28. public $int2 = 2;
  29. }
  30. test_schema($schema,'type="tns:testType"',new B());
  31. echo "ok";
  32. ?>
  33. --EXPECT--
  34. <?xml version="1.0" encoding="UTF-8"?>
  35. <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>
  36. object(stdClass)#5 (2) {
  37. ["int"]=>
  38. int(1)
  39. ["int2"]=>
  40. int(2)
  41. }
  42. ok