xref: /php-src/ext/soap/tests/schema/schema085.phpt (revision 7f2f0c00)
1--TEST--
2SOAP XML Schema 85: Extension of complex type (elements order)
3--EXTENSIONS--
4soap
5xml
6--FILE--
7<?php
8include "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>
24EOF;
25class A {
26  public $int = 1;
27}
28
29class B extends A {
30  public $int2 = 2;
31}
32
33
34test_schema($schema,'type="tns:testType"',new B());
35echo "ok";
36?>
37--EXPECTF--
38<?xml version="1.0" encoding="UTF-8"?>
39<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>
40object(stdClass)#%d (2) {
41  ["int"]=>
42  int(1)
43  ["int2"]=>
44  int(2)
45}
46ok
47