/**
  *
  */
 public function testIsEnumeration()
 {
     $wsdl = WsdlTest::bingInstance();
     $restrictions = $wsdl->getContent()->getElementsByName(Wsdl::TAG_RESTRICTION);
     foreach ($restrictions as $restriction) {
         $this->assertTrue($restriction->isEnumeration());
     }
 }
 /**
  *
  */
 public function testGetValue()
 {
     $schema = WsdlTest::numericEnumerationInstance();
     $enumeration = $schema->getContent()->getElementsByName(Wsdl::TAG_ENUMERATION);
     foreach ($enumeration as $index => $enumeration) {
         $this->assertSame(sprintf('0%s', $index + 1), $enumeration->getValue());
     }
 }
Exemplo n.º 3
0
 /**
  *
  */
 public function testGetSuitableParent()
 {
     $wsdl = WsdlTest::odigeoInstance();
     $lists = $wsdl->getContent()->getElementsByName(Wsdl::TAG_LIST);
     $this->assertCount(4, $lists);
     foreach ($lists as $list) {
         $this->assertSame('int', $list->getAttributeItemType());
     }
 }
Exemplo n.º 4
0
 /**
  *
  */
 public function testGetAttributeRequired()
 {
     $wsdl = WsdlTest::actonInstance();
     $binding = $wsdl->getContent()->getElementByNameAndAttributes(Wsdl::TAG_BINDING, array('name' => 'SoapBinding', 'type' => 'tns:SOAP'));
     $operation = $binding->getChildByNameAndAttributes(Wsdl::TAG_OPERATION, array('name' => 'list'));
     $sessionHeader = $operation->getChildByNameAndAttributes(Wsdl::TAG_HEADER, array('part' => 'SessionHeader'));
     $clusterHeader = $operation->getChildByNameAndAttributes(Wsdl::TAG_HEADER, array('part' => 'ClusterHeader'));
     $this->assertFalse($sessionHeader->getAttributeRequired());
     $this->assertTrue($clusterHeader->getAttributeRequired());
 }
Exemplo n.º 5
0
 /**
  *
  */
 public function testGetLocationAttribute()
 {
     $wsdl = WsdlTest::partnerInstance(false);
     $imports = $wsdl->getContent()->getElementsByName(Wsdl::TAG_IMPORT);
     $count = 0;
     foreach ($imports as $index => $import) {
         $this->assertSame(sprintf('http://secapp.euroconsumers.org/partnerservice/PartnerService.svc?xsd=xsd%d', $index), $import->getLocationAttribute());
         $count++;
     }
     $this->assertSame(19, $count);
 }
 /**
  *
  */
 public function testGetSuitableParentAsEnumeration()
 {
     $wsdl = WsdlTest::ebayInstance();
     $enumeration = $wsdl->getContent()->getElementByNameAndAttributes(Wsdl::TAG_ENUMERATION, array('value' => 'Success'));
     $this->assertSame('Success', $enumeration->getValue());
     $documentation = $enumeration->getChildByNameAndAttributes(Wsdl::TAG_DOCUMENTATION, array());
     $this->assertSame('(out) Request processing succeeded', $documentation->getValue());
     $this->assertInstanceOf('\\WsdlToPhp\\PackageGenerator\\DomHandler\\Wsdl\\Tag\\TagDocumentation', $documentation);
     $this->assertInstanceOf('\\WsdlToPhp\\PackageGenerator\\DomHandler\\Wsdl\\Tag\\TagEnumeration', $documentation->getSuitableParent());
     $this->assertSame($enumeration->getValue(), $documentation->getSuitableParent()->getValue());
 }
Exemplo n.º 7
0
 /**
  *
  */
 public function testGetAttributeMemberTypes()
 {
     $wsdl = WsdlTest::orderContractInstance();
     $unions = $wsdl->getContent()->getElementsByName(Wsdl::TAG_UNION);
     $this->assertCount(2, $unions);
     $ok = false;
     foreach ($unions as $union) {
         switch ($union->getSuitableParent()->getAttributeName()) {
             case 'RelationshipTypeOpenEnum':
                 $this->assertSame(array('RelationshipType', 'anyURI'), $union->getAttributeMemberTypes());
                 $ok |= true;
                 break;
             case 'FaultCodesOpenEnumType':
                 $this->assertSame(array('FaultCodesType', 'QName'), $union->getAttributeMemberTypes());
                 $ok |= true;
                 break;
         }
     }
     $this->assertTrue((bool) $ok);
 }
Exemplo n.º 8
0
 /**
  *
  */
 public function testGetPart()
 {
     $wsdl = WsdlTest::ebayInstance();
     $messages = $wsdl->getContent()->getElementsByName(Wsdl::TAG_MESSAGE);
     $this->assertInstanceOf('\\WsdlToPhp\\PackageGenerator\\DomHandler\\Wsdl\\Tag\\TagPart', $messages[0]->getPart('RequesterCredentials'));
 }