/** * Test data type details for the same type name set multiple times. */ public function testSetTypeDataArrayMerge() { $this->_typeProcessor->setTypeData('typeA', array('dataA1')); $this->_typeProcessor->setTypeData('typeA', array('dataA2')); $this->_typeProcessor->setTypeData('typeA', array('dataA3')); $this->assertEquals(array('dataA1', 'dataA2', 'dataA3'), $this->_typeProcessor->getTypeData('typeA')); }
/** * Add complex type. * * @param string $type * @param array $parentCallInfo array of callInfo from parent complex type * @return string * @throws \InvalidArgumentException */ public function addComplexType($type, $parentCallInfo = array()) { if (($soapType = $this->scanRegisteredTypes($type)) !== null) { return $soapType; } $soapType = Wsdl::TYPES_NS . ':' . $type; // Register type here to avoid recursion $this->getContext()->addType($type, $soapType); $complexType = $this->_getDom()->createElement(Wsdl::XSD_NS . ':complexType'); $complexType->setAttribute('name', $type); $typeData = $this->_typeProcessor->getTypeData($type); if (isset($typeData['documentation'])) { $this->addAnnotation($complexType, $typeData['documentation']); } if (isset($typeData['parameters']) && is_array($typeData['parameters'])) { $callInfo = isset($typeData['callInfo']) ? $typeData['callInfo'] : $parentCallInfo; $sequence = $this->_processParameters($typeData['parameters'], $callInfo); $complexType->appendChild($sequence); } $this->getContext()->getSchema()->appendChild($complexType); return $soapType; }