|
@@ 94-112 (lines=19) @@
|
| 91 |
|
/** |
| 92 |
|
* @test |
| 93 |
|
*/ |
| 94 |
|
public function shouldParseSimpleObject() |
| 95 |
|
{ |
| 96 |
|
//given |
| 97 |
|
$parameter = ParameterFactory::createParameterForSimpleObject('method'); |
| 98 |
|
|
| 99 |
|
//when |
| 100 |
|
$types = $this->_documentLiteralWrapped->typeParameters($parameter); |
| 101 |
|
|
| 102 |
|
//then |
| 103 |
|
$type = $types[0]; |
| 104 |
|
$this->assertEquals('method', $type->getName()); |
| 105 |
|
$this->assertEquals(array(array('type' => 'element', 'value' => 'ns:Info', 'name' => 'info')), $type->getElementAttributes()); |
| 106 |
|
Assert::thatArray($type->getComplex())->onMethod('getName')->containsExactly('Info'); |
| 107 |
|
Assert::thatArray($type->getComplex())->onMethod('getElementAttributes') |
| 108 |
|
->containsKeyAndValue(array(array( |
| 109 |
|
array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name'), |
| 110 |
|
array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age') |
| 111 |
|
))); |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
/** |
| 115 |
|
* @test |
|
@@ 253-270 (lines=18) @@
|
| 250 |
|
/** |
| 251 |
|
* @test |
| 252 |
|
*/ |
| 253 |
|
public function shouldParseReturnSimpleObject() |
| 254 |
|
{ |
| 255 |
|
//given |
| 256 |
|
$parameter = ParameterFactory::createReturnForSimpleObject('method'); |
| 257 |
|
|
| 258 |
|
//when |
| 259 |
|
$element = $this->_documentLiteralWrapped->typeReturning($parameter); |
| 260 |
|
|
| 261 |
|
//then |
| 262 |
|
$this->assertEquals('methodResponse', $element->getName()); |
| 263 |
|
$this->assertEquals(array(array('type' => 'element', 'value' => 'ns:Info', 'name' => 'info')), $element->getElementAttributes()); |
| 264 |
|
Assert::thatArray($element->getComplex())->onMethod('getName')->containsExactly('Info'); |
| 265 |
|
Assert::thatArray($element->getComplex())->onMethod('getElementAttributes') |
| 266 |
|
->containsKeyAndValue(array(array( |
| 267 |
|
array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name'), |
| 268 |
|
array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age') |
| 269 |
|
))); |
| 270 |
|
} |
| 271 |
|
|
| 272 |
|
/** |
| 273 |
|
* @test |