コード例 #1
0
ファイル: RpcEncodedTest.php プロジェクト: phogl/autoloader
 /**
  * @test
  */
 public function shouldParseArrayOfObjects()
 {
     //given
     $parameter = ParameterFactory::createParameterForArrayOfObjects();
     //when
     $types = $this->_rpcEncoded->typeParameters($parameter);
     //then
     $type = $types[0];
     $this->assertEquals('ArrayOfCompanies', $type->getName());
     $this->assertEquals('ns:Companies[]', $type->getArrayType());
     $this->assertEquals('Companies', $type->getComplex()->getName());
     $this->assertEquals(array(array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name'), array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id')), $type->getComplex()->getElementAttributes());
 }
コード例 #2
0
 /**
  * @test
  */
 public function shouldParseArrayOfObjects()
 {
     //given
     $parameter = ParameterFactory::createParameterForArrayOfObjects('method');
     //when
     $types = $this->_documentLiteralWrapped->typeParameters($parameter);
     //then
     $type = $types[0];
     $this->assertEquals('method', $type->getName());
     $this->assertEquals(array(array('type' => 'type', 'value' => 'ns:ArrayOfCompanies', 'name' => 'companies')), $type->getElementAttributes());
     $actualContext = $type->getComplex();
     Assert::thatArray($actualContext)->onMethod('getName')->containsExactly('ArrayOfCompanies');
     Assert::thatArray($actualContext)->onMethod('getArrayType')->containsExactly('ns:Companies[]');
     $this->assertEquals('Companies', $actualContext[0]->getComplex()->getName());
     $this->assertEquals(array(array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name'), array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id')), $actualContext[0]->getComplex()->getElementAttributes());
 }