/** * @group ZF-5149 */ public function testArrayOfComplexNestedObjectsIsCoveredByStrategyAndAddsAllTypesRecursivly() { $return = $this->wsdl->addComplexType('\\ZendTest\\Soap\\TestAsset\\ComplexTypeA'); $wsdl = $this->wsdl->toXml(); $this->assertEquals(1, substr_count($wsdl, '<xsd:complexType name="ComplexTypeA">'), 'No definition of complex type A found.'); $this->assertEquals(1, substr_count($wsdl, '<xsd:complexType name="ArrayOfComplexTypeB">'), 'No definition of complex type B array found.'); $this->assertEquals(1, substr_count($wsdl, 'wsdl:arrayType="tns:ComplexTypeB[]"'), 'No usage of Complex Type B array found.'); }
/** * @group ZF-5430 */ public function testMultipleSequenceDefinitionsOfSameTypeWillBeRecognizedOnceBySequenceStrategy() { $wsdl = new Wsdl("MyService", "http://localhost/MyService.php"); $wsdl->setComplexTypeStrategy(new Strategy\ArrayOfTypeSequence()); $wsdl->addComplexType("string[]"); $wsdl->addComplexType("int[]"); $wsdl->addComplexType("string[]"); $xml = $wsdl->toXml(); $this->assertEquals(1, substr_count($xml, "ArrayOfString"), "ArrayOfString should appear only once."); $this->assertEquals(1, substr_count($xml, "ArrayOfInt"), "ArrayOfInt should appear only once."); }