<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<list> \t\t\t<simpleType> \t\t\t\t<restriction base="int"/> \t\t\t</simpleType> \t\t</list> \t</simpleType> EOF; test_schema($schema, 'type="tns:testType"', array(123, 456.7)); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<union memberTypes="string int float"/> \t</simpleType> EOF; test_schema($schema, 'type="tns:testType"', "str"); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<attribute name="int1" type="int"/> \t\t<attribute name="int2" type="int" form="qualified"/> \t\t<attribute name="int3" type="int" form="unqualified"/> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("int1" => 1.1, "int2" => 2.2, "int3" => 3.3), "rpc", "encoded"); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<sequence> \t\t\t<element name="str" type="string"/> \t\t</sequence> \t\t<attribute name="int" type="int"/> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("str" => "str", "int" => 123.5)); echo "ok";
<?php include "test_schema.inc"; $schema = ''; test_schema($schema, 'type="xsd:unsignedLong"', 0xffffffff); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType2"> \t\t<sequence> \t\t\t<element name="int" type="int"/> \t\t</sequence> \t</complexType> \t<complexType name="testType"> \t\t<complexContent> \t\t\t<extension base="tns:testType2"> \t\t\t\t<sequence> \t\t\t\t\t<element name="int2" type="int"/> \t\t\t\t</sequence> \t\t\t</extension> \t\t</complexContent> \t</complexType> EOF; class A { public $int = 1; } class B extends A { public $int2 = 2; } test_schema($schema, 'type="tns:testType"', new B()); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<element name="testElement" type="tns:testType"/> \t<complexType name="testType"> \t\t<complexContent> \t\t\t<restriction base="SOAP-ENC:Array"> \t <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> \t</restriction> </complexContent> \t</complexType> EOF; test_schema($schema, 'element="tns:testElement"', array(123, 123.5), 'document', 'literal'); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<sequence> \t\t\t<element name="int1" type="int"/> \t\t\t<element name="int2" type="int" form="qualified"/> \t\t\t<element name="int3" type="int" form="unqualified"/> \t\t</sequence> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("int1" => 1.1, "int2" => 2.2, "int3" => 3.3), "rpc", "literal", 'elementFormDefault="unqualified"'); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<complexContent> \t\t\t<extension base="apache:Map" xmlns:apache="http://xml.apache.org/xml-soap"> \t</extension> </complexContent> \t</complexType> EOF; test_schema($schema, 'type="testType"', array('a' => 123, 'b' => 123.5)); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<list> \t\t\t<simpleType> \t\t\t\t<union memberTypes="int float str"/> \t\t\t</simpleType> \t\t</list> \t</simpleType> EOF; test_schema($schema, 'type="tns:testType"', "123 123.5 456.7 str"); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<list itemType="token"/> \t</simpleType> EOF; test_schema($schema, 'type="tns:testType"', "one two"); echo "ok";
<?php include "test_schema.inc"; $schema = ''; test_schema($schema, 'type="apache:Map" xmlns:apache="http://xml.apache.org/xml-soap"', array('a' => 123, 'b' => 123.5)); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<union> \t\t\t<simpleType> \t\t\t\t<restriction base="float"/> \t\t\t</simpleType> \t\t\t<simpleType> \t\t\t\t<list itemType="int"/> \t\t\t</simpleType> \t\t</union> \t</simpleType> EOF; test_schema($schema, 'type="tns:testType"', "123.5"); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<complexContent> \t\t\t<restriction base="SOAP-ENC:Array"> \t\t\t\t<all> \t\t\t\t\t<element name="x_item" type="int" maxOccurs="unbounded"/> \t\t </all> \t</restriction> </complexContent> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', array(123, 123.5)); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<restriction> \t\t\t<simpleType name="testType2"> \t\t <restriction base="xsd:int"/> \t </simpleType> \t </restriction> \t</simpleType> \t<element name="testElement" type="tns:testType"/> EOF; test_schema($schema, 'element="tns:testElement"', 123.5); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<simpleContent> \t\t\t<restriction base="int"> \t\t\t\t<attribute name="int" type="int"/> \t\t\t</restriction> \t\t</simpleContent> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("_" => NULL, "int" => 123.5)); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<sequence> \t\t\t<element name="dateTime" type="dateTime"/> \t\t\t<element name="time" type="time"/> \t\t\t<element name="date" type="date"/> \t\t\t<element name="gYearMonth" type="gYearMonth"/> \t\t\t<element name="gYear" type="gYear"/> \t\t\t<element name="gMonthDay" type="gMonthDay"/> \t\t\t<element name="gDay" type="gDay"/> \t\t\t<element name="gMonth" type="gMonth"/> \t\t</sequence> \t</complexType> EOF; $date = gmmktime(1, 2, 3, 4, 5, 1976); putenv('TZ=GMT'); test_schema($schema, 'type="tns:testType"', array('dateTime' => $date, 'time' => $date, 'date' => $date, 'gYearMonth' => $date, 'gYear' => $date, 'gMonthDay' => $date, 'gDay' => $date, 'gMonth' => $date)); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<sequence> \t\t\t<element name="str" type="string"/> \t\t</sequence> \t\t<attribute name="int" type="int"/> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("str" => "str", "int" => 123.5), "rpc", "encoded", 'attributeFormDefault="qualified"'); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<attribute name="int1" type="int"/> \t\t<attribute name="int2" type="int" form="qualified"/> \t\t<attribute name="int3" type="int" form="unqualified"/> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("int1" => 1.1, "int2" => 2.2, "int3" => 3.3), "rpc", "encoded", 'attributeFormDefault="unqualified"'); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<complexContent> \t\t\t<restriction base="SOAP-ENC:Array"> \t\t\t\t<all> \t\t\t\t\t<element name="x_item" type="int" maxOccurs="unbounded"/> \t\t </all> \t</restriction> </complexContent> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', array(123, 123.5), 'rpc', 'literal'); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<sequence> \t\t\t<element name="int" type="int"/> \t\t\t<element name="int2" type="int" maxOccurs="unbounded"/> \t\t</sequence> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("int" => 123.5, "int2" => array(123.5, 456.7))); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<restriction base="tns:testType2"/> \t</simpleType> EOF; test_schema($schema, 'type="tns:testType"', 123.5); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<complexContent> \t\t\t<restriction base="enc12:Array" xmlns:enc12="http://www.w3.org/2003/05/soap-encoding"> \t <attribute ref="enc12:itemType" wsdl:itemType="int"/> \t <attribute ref="enc12:arraySize" wsdl:arraySize="*"/> \t</restriction> </complexContent> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', array(123, 123.5), "rpc", "encoded", '', SOAP_USE_XSI_ARRAY_TYPE); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<element name="testType2" type="tns:testType2"/> \t<complexType name="testType2"> \t\t<sequence> \t\t\t<element name="int" type="int"/> \t\t</sequence> \t</complexType> \t<complexType name="testType"> \t\t<sequence> \t\t\t<element name="int" type="int"/> \t\t\t<element ref="tns:testType2"/> \t\t</sequence> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("int" => 123.5, "testType2" => array("int" => 123.5))); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<list itemType="token"/> \t</simpleType> EOF; test_schema($schema, 'type="tns:testType"', array("one", "two")); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<complexType name="testType"> \t\t<attribute name="str" type="string"/> \t\t<attribute name="int" type="int" default="5"/> \t</complexType> EOF; test_schema($schema, 'type="tns:testType"', (object) array("str" => "str")); echo "ok";
<?php include "test_schema.inc"; $schema = <<<EOF \t<simpleType name="testType"> \t\t<list> \t\t\t<simpleType> \t\t\t\t<restriction base="int"/> \t\t\t</simpleType> \t\t</list> \t</simpleType> EOF; test_schema($schema, 'type="tns:testType"', "123 456.7"); echo "ok";