Skip to content

Commit

Permalink
Add various tests
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Jan 28, 2022
1 parent 8e29e8d commit c6559db
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Unit/Xml/Configurator/FlattenXsdImportsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,17 @@ public function provideTestCases()
'wsdl' => FIXTURE_DIR.'/flattening/circular-xsd.wsdl',
'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/circular-xsd-result.wsdl', comparable()),
];
yield 'redefine-xsd' => [
'wsdl' => FIXTURE_DIR.'/flattening/redefine-xsd.wsdl',
'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/redefine-xsd-result.wsdl', comparable()),
];
yield 'tnsless-xsd' => [
'wsdl' => FIXTURE_DIR.'/flattening/tnsless-xsd.wsdl',
'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/tnsless-xsd-result.wsdl', comparable()),
];
yield 'grouped-xsd' => [
'wsdl' => FIXTURE_DIR.'/flattening/grouped-xsd.wsdl',
'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/grouped-xsd-result.wsdl', comparable()),
];
}
}
12 changes: 12 additions & 0 deletions tests/fixtures/flattening/grouped-xsd.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<definitions name="InteropTest"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://soapinterop.org/">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
<xsd:import schemaLocation="xsd/store1.xsd" namespace="http://soapinterop.org/store1" />
<xsd:import schemaLocation="xsd/store1-extras.xsd" namespace="http://soapinterop.org/store1" />
</schema>
</types>
</definitions>
22 changes: 22 additions & 0 deletions tests/fixtures/flattening/redefine-xsd.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://soapinterop.org/"
targetNamespace="http://soapinterop.org/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema targetNamespace="http://soapinterop.org/store1">
<xsd:redefine schemaLocation="xsd/store1.xsd">
<xsd:complexType name="Store">
<xsd:complexContent>
<xsd:extension base="Store">
<xsd:sequence>
<xsd:element name="extra" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:redefine>
</xsd:schema>
</types>
</definitions>
24 changes: 24 additions & 0 deletions tests/fixtures/flattening/result/grouped-xsd-result.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<definitions name="InteropTest"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://soapinterop.org/">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
<xsd:import namespace="http://soapinterop.org/store1" />
<xsd:import namespace="http://soapinterop.org/store1" />
</schema>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/store1">
<xsd:complexType name="Store">
<xsd:sequence>
<element minOccurs="1" maxOccurs="1" name="Attribute1" type="string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="StoreInfo">
<xsd:sequence>
<element minOccurs="1" maxOccurs="1" name="Attribute1" type="string"/>
</xsd:sequence>
</xsd:complexType>
</schema>
</types>
</definitions>
25 changes: 25 additions & 0 deletions tests/fixtures/flattening/result/redefine-xsd-result.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://soapinterop.org/"
targetNamespace="http://soapinterop.org/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema targetNamespace="http://soapinterop.org/store1">
<xsd:complexType name="Store">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="Attribute1" type="string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Store">
<xsd:complexContent>
<xsd:extension base="Store">
<xsd:sequence>
<xsd:element name="extra" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>
19 changes: 19 additions & 0 deletions tests/fixtures/flattening/result/tnsless-xsd-result.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://soapinterop.org/"
targetNamespace="http://soapinterop.org/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema targetNamespace="http://soapinterop.org/store1">

</xsd:schema>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Store">
<xsd:sequence>
<element minOccurs="1" maxOccurs="1" name="Attribute1" type="string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>
12 changes: 12 additions & 0 deletions tests/fixtures/flattening/tnsless-xsd.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://soapinterop.org/"
targetNamespace="http://soapinterop.org/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema targetNamespace="http://soapinterop.org/store1">
<xsd:include schemaLocation="xsd/tnsless.xsd" />
</xsd:schema>
</types>
</definitions>
7 changes: 7 additions & 0 deletions tests/fixtures/flattening/xsd/store1-extras.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/store1">
<xsd:complexType name="StoreInfo">
<xsd:sequence>
<element minOccurs="1" maxOccurs="1" name="Attribute1" type="string"/>
</xsd:sequence>
</xsd:complexType>
</schema>
7 changes: 7 additions & 0 deletions tests/fixtures/flattening/xsd/tnsless.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Store">
<xsd:sequence>
<element minOccurs="1" maxOccurs="1" name="Attribute1" type="string"/>
</xsd:sequence>
</xsd:complexType>
</schema>

0 comments on commit c6559db

Please sign in to comment.