/** * @test */ public function shouldParseObjectWithArrayOfElement() { //given $parameter = ParameterFactory::createParameterForObjectWithArrayOfSimpleType(); //when $types = $this->_rpcEncoded->typeParameters($parameter); //then $type = $types[0]; $this->assertEquals('NamesInfo', $type->getName()); $this->assertEquals(array(array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names'), array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id')), $type->getElementAttributes()); Assert::thatArray($type->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames'); Assert::thatArray($type->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]'); }
/** * @test */ public function shouldParseObjectWithArrayOfElement() { //given $parameter = ParameterFactory::createParameterForObjectWithArrayOfSimpleType('method'); //when $types = $this->_documentLiteralWrapped->typeParameters($parameter); //then $type = $types[0]; $this->assertEquals('method', $type->getName()); $this->assertEquals(array(array('type' => 'element', 'value' => 'ns:NamesInfo', 'name' => 'namesInfo', 'optional' => false)), $type->getElementAttributes()); $actualContext = $type->getComplex(); Assert::thatArray($actualContext)->onMethod('getName')->containsExactly('NamesInfo'); Assert::thatArray($actualContext)->onMethod('getElementAttributes')->containsKeyAndValue(array(array(array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names', 'optional' => false), array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)))); Assert::thatArray($actualContext[0]->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames'); Assert::thatArray($actualContext[0]->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]'); }