xref: /PHP-7.3/ext/soap/tests/schema/schema047.phpt (revision 55c25c72)
1--TEST--
2SOAP XML Schema 47: Extension of complex type (2)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7include "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				<attribute name="int2" type="int"/>
18			</extension>
19		</complexContent>
20	</complexType>
21EOF;
22test_schema($schema,'type="tns:testType"',(object)array("_"=>123.5,"int"=>123.5,"int2"=>123.5));
23echo "ok";
24?>
25--EXPECTF--
26<?xml version="1.0" encoding="UTF-8"?>
27<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"><int xsi:type="xsd:int">123</int></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
28object(stdClass)#%d (2) {
29  ["int"]=>
30  int(123)
31  ["int2"]=>
32  int(123)
33}
34ok
35