|
@@ 74-89 (lines=16) @@
|
| 71 |
|
/** |
| 72 |
|
* @test |
| 73 |
|
*/ |
| 74 |
|
public function shouldParseArrayWithSimpleType() |
| 75 |
|
{ |
| 76 |
|
//given |
| 77 |
|
$method = ParameterFactory::createParameterForSimpleArray('method'); |
| 78 |
|
|
| 79 |
|
//when |
| 80 |
|
$types = $this->_documentLiteralWrapped->typeParameters($method); |
| 81 |
|
|
| 82 |
|
//then |
| 83 |
|
$type = $types[0]; |
| 84 |
|
// convention 4, input wrapper element name should match with Operation name |
| 85 |
|
$this->assertEquals('method', $type->getName()); |
| 86 |
|
$this->assertEquals(array(array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names')), $type->getElementAttributes()); |
| 87 |
|
Assert::thatArray($type->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames'); |
| 88 |
|
Assert::thatArray($type->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]'); |
| 89 |
|
} |
| 90 |
|
|
| 91 |
|
/** |
| 92 |
|
* @test |
|
@@ 234-248 (lines=15) @@
|
| 231 |
|
/** |
| 232 |
|
* @test |
| 233 |
|
*/ |
| 234 |
|
public function shouldParseReturnArrayWithSimpleType() |
| 235 |
|
{ |
| 236 |
|
//given |
| 237 |
|
$method = ParameterFactory::createReturnForSimpleArray('method'); |
| 238 |
|
|
| 239 |
|
//when |
| 240 |
|
$element = $this->_documentLiteralWrapped->typeReturning($method); |
| 241 |
|
|
| 242 |
|
//then |
| 243 |
|
// convention 4, input wrapper element name should match with Operation name |
| 244 |
|
$this->assertEquals('methodResponse', $element->getName()); |
| 245 |
|
$this->assertEquals(array(array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names')), $element->getElementAttributes()); |
| 246 |
|
Assert::thatArray($element->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames'); |
| 247 |
|
Assert::thatArray($element->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]'); |
| 248 |
|
} |
| 249 |
|
|
| 250 |
|
/** |
| 251 |
|
* @test |