xref: /PHP-7.0/ext/soap/tests/schema/schema041.phpt (revision a830b0fc)
1--TEST--
2SOAP XML Schema 41: Structure (group)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7include "test_schema.inc";
8$schema = <<<EOF
9	<complexType name="testType">
10		<group ref="tns:testGroup"/>
11	</complexType>
12	<group name="testGroup">
13		<sequence>
14			<element name="int" type="int"/>
15			<element name="str" type="string"/>
16		</sequence>
17	</group>
18EOF;
19test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>123.5));
20echo "ok";
21?>
22--EXPECTF--
23<?xml version="1.0" encoding="UTF-8"?>
24<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">123</int><str xsi:type="xsd:string">str</str></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
25object(stdClass)#%d (2) {
26  ["int"]=>
27  int(123)
28  ["str"]=>
29  string(3) "str"
30}
31ok
32