schema045.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. SOAP XML Schema 45: Restriction of simple type (2)
  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. <simpleContent>
  11. <extension base="int">
  12. <attribute name="int" type="int"/>
  13. </extension>
  14. </simpleContent>
  15. </complexType>
  16. <complexType name="testType">
  17. <simpleContent>
  18. <restriction base="tns:testType2">
  19. <attribute name="int2" type="int"/>
  20. </restriction>
  21. </simpleContent>
  22. </complexType>
  23. EOF;
  24. test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5));
  25. echo "ok";
  26. ?>
  27. --EXPECTF--
  28. <?xml version="1.0" encoding="UTF-8"?>
  29. <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" int2="123">123</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
  30. object(stdClass)#%d (2) {
  31. ["_"]=>
  32. int(123)
  33. ["int2"]=>
  34. int(123)
  35. }
  36. ok