|
@@ 149-172 (lines=24) @@
|
| 146 |
|
/** |
| 147 |
|
* @test |
| 148 |
|
*/ |
| 149 |
|
public function shouldParseObjectWithArrayOfElement() |
| 150 |
|
{ |
| 151 |
|
//given |
| 152 |
|
$parameter = ParameterFactory::createParameterForObjectWithArrayOfSimpleType('method'); |
| 153 |
|
|
| 154 |
|
//when |
| 155 |
|
$types = $this->_documentLiteralWrapped->typeParameters($parameter); |
| 156 |
|
|
| 157 |
|
//then |
| 158 |
|
$type = $types[0]; |
| 159 |
|
$this->assertEquals('method', $type->getName()); |
| 160 |
|
$this->assertEquals(array( |
| 161 |
|
array('type' => 'element', 'value' => 'ns:NamesInfo', 'name' => 'namesInfo') |
| 162 |
|
), $type->getElementAttributes()); |
| 163 |
|
$actualContext = $type->getComplex(); |
| 164 |
|
Assert::thatArray($actualContext)->onMethod('getName')->containsExactly('NamesInfo'); |
| 165 |
|
Assert::thatArray($actualContext)->onMethod('getElementAttributes') |
| 166 |
|
->containsKeyAndValue(array(array( |
| 167 |
|
array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names'), |
| 168 |
|
array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id') |
| 169 |
|
))); |
| 170 |
|
Assert::thatArray($actualContext[0]->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames'); |
| 171 |
|
Assert::thatArray($actualContext[0]->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]'); |
| 172 |
|
} |
| 173 |
|
|
| 174 |
|
/** |
| 175 |
|
* @test |
|
@@ 307-330 (lines=24) @@
|
| 304 |
|
/** |
| 305 |
|
* @test |
| 306 |
|
*/ |
| 307 |
|
public function shouldParseReturnObjectWithArrayOfElement() |
| 308 |
|
{ |
| 309 |
|
//given |
| 310 |
|
$parameter = ParameterFactory::createReturnForObjectWithArrayOfSimpleType('method'); |
| 311 |
|
|
| 312 |
|
//when |
| 313 |
|
$element = $this->_documentLiteralWrapped->typeReturning($parameter); |
| 314 |
|
|
| 315 |
|
//then |
| 316 |
|
$this->assertEquals('methodResponse', $element->getName()); |
| 317 |
|
$this->assertEquals(array( |
| 318 |
|
array('type' => 'element', 'value' => 'ns:NamesInfo', 'name' => 'namesInfo') |
| 319 |
|
), $element->getElementAttributes()); |
| 320 |
|
|
| 321 |
|
$actualComplex = $element->getComplex(); |
| 322 |
|
Assert::thatArray($actualComplex)->onMethod('getName')->containsExactly('NamesInfo'); |
| 323 |
|
Assert::thatArray($actualComplex)->onMethod('getElementAttributes') |
| 324 |
|
->containsKeyAndValue(array(array( |
| 325 |
|
array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names'), |
| 326 |
|
array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id') |
| 327 |
|
))); |
| 328 |
|
Assert::thatArray($actualComplex[0]->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames'); |
| 329 |
|
Assert::thatArray($actualComplex[0]->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]'); |
| 330 |
|
} |
| 331 |
|
|
| 332 |
|
/** |
| 333 |
|
* @test |