Example #1
0
 /**
  * @test
  */
 public function shouldParseSimpleObject()
 {
     //given
     $parameter = ParameterFactory::createParameterForSimpleObject();
     //when
     $types = $this->_rpcEncoded->typeParameters($parameter);
     //then
     $type = $types[0];
     $this->assertEquals('Info', $type->getName());
     $this->assertEquals(array(array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name'), array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age')), $type->getElementAttributes());
     //        $this->assertNull($type->getComplex());
 }
 /**
  * @test
  */
 public function shouldParseSimpleObject()
 {
     //given
     $parameter = ParameterFactory::createParameterForSimpleObject('method');
     //when
     $types = $this->_documentLiteralWrapped->typeParameters($parameter);
     //then
     $type = $types[0];
     $this->assertEquals('method', $type->getName());
     $this->assertEquals(array(array('type' => 'element', 'value' => 'ns:Info', 'name' => 'info')), $type->getElementAttributes());
     Assert::thatArray($type->getComplex())->onMethod('getName')->containsExactly('Info');
     Assert::thatArray($type->getComplex())->onMethod('getElementAttributes')->containsKeyAndValue(array(array(array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name'), array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age'))));
 }