xref: /PHP-8.2/ext/soap/tests/schema/schema077.phpt (revision 7f2f0c00)
1--TEST--
2SOAP XML Schema 77: Attributes form qualified/unqualified (attributeFormDefault - default)
3--EXTENSIONS--
4soap
5xml
6--FILE--
7<?php
8include "test_schema.inc";
9$schema = <<<EOF
10    <complexType name="testType">
11        <attribute name="int1" type="int"/>
12        <attribute name="int2" type="int" form="qualified"/>
13        <attribute name="int3" type="int" form="unqualified"/>
14    </complexType>
15EOF;
16
17test_schema($schema,'type="tns:testType"',(object)array("int1"=>1.1,"int2"=>2.2,"int3"=>3.3), "rpc", "encoded");
18echo "ok";
19?>
20--EXPECTF--
21<?xml version="1.0" encoding="UTF-8"?>
22<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
23object(stdClass)#%d (3) {
24  ["int1"]=>
25  int(1)
26  ["int2"]=>
27  int(2)
28  ["int3"]=>
29  int(3)
30}
31ok
32