Esempio n. 1
0
 /**
  * Test adding complex type with complex parameters and arrays.
  */
 public function testAddComplexTypeComplexParameters()
 {
     $type = 'VendorModuleADataStructure';
     $parameterType = 'ComplexType';
     $typeData = array('documentation' => 'test', 'parameters' => array('complex_param' => array('type' => $parameterType, 'required' => true, 'documentation' => 'complex type param.')));
     $parameterData = array('documentation' => 'test', 'parameters' => array('string_param' => array('type' => 'ComplexTypeB[]', 'required' => true, 'documentation' => 'string param.')));
     $this->_wsdl->expects($this->at(0))->method('getTypes')->will($this->returnValue(array()));
     $this->_wsdl->expects($this->any())->method('getTypes')->will($this->returnValue(array($type => Wsdl::TYPES_NS . ':' . $type)));
     $this->_wsdl->expects($this->any())->method('toDomDocument')->will($this->returnValue(new \DOMDocument()));
     $schemaMock = $this->getMock('DOMElement', [], ['a']);
     $schemaMock->expects($this->any())->method('appendChild');
     $this->_wsdl->expects($this->any())->method('getSchema')->will($this->returnValue($schemaMock));
     $this->_typeProcessor->expects($this->at(0))->method('getTypeData')->with($type)->will($this->returnValue($typeData));
     $this->_typeProcessor->expects($this->at(1))->method('getTypeData')->with($parameterType)->will($this->returnValue($parameterData));
     $this->assertEquals(Wsdl::TYPES_NS . ':' . $type, $this->_strategy->addComplexType($type));
 }
Esempio n. 2
0
 /**
  * Set up helper.
  */
 protected function setUp()
 {
     $this->_typeProcessor = $this->getMock('\\Magento\\Webapi\\Model\\Config\\ClassReflector\\TypeProcessor', array('process'), array(), '', false);
     $this->_typeProcessor->expects($this->any())->method('process')->will($this->returnValueMap(array(array('string', 'str'), array('int', 'int'))));
     $this->_classReflector = new \Magento\Webapi\Model\Config\ClassReflector($this->_typeProcessor);
 }