File: tests/DomHandler/Wsdl/Tag/TagDocumentationTest.php

Recommend this page to a friend!
  Classes of WsdlToPhp  >  PHP SOAP Package Generator  >  tests/DomHandler/Wsdl/Tag/TagDocumentationTest.php  >  Download  
File: tests/DomHandler/Wsdl/Tag/TagDocumentationTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHP SOAP Package Generator
Generate package to call SOAP services using WSDL
Author: By
Last change:
Date: 5 years ago
Size: 1,841 bytes
 

Contents

Class file image Download
<?php

namespace WsdlToPhp\PackageGenerator\Tests\DomHandler\Wsdl\Tag;

use
WsdlToPhp\PackageGenerator\Tests\TestCase;
use
WsdlToPhp\PackageGenerator\Tests\Model\WsdlTest;
use
WsdlToPhp\PackageGenerator\DomHandler\Wsdl\Wsdl;
use
WsdlToPhp\PackageGenerator\DomHandler\Wsdl\Tag\AbstractTag;

class
TagDocumentationTest extends TestCase
{
   
/**
     *
     */
   
public function testGetSuitableParent()
    {
       
$schema = WsdlTest::imageServiceViewAvailRequestInstance();

       
$documentations = $schema->getContent()->getElementsByName(Wsdl::TAG_DOCUMENTATION);

       
$ok = false;
        foreach (
$documentations as $documentation) {
           
$parent = $documentation->getSuitableParent();
            if (
$parent instanceof AbstractTag) {
               
$this->assertSame('availRequest', $parent->getAttributeName());
               
$ok = true;
            }
        }
       
$this->assertTrue($ok);
    }
   
/**
     *
     */
   
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());
    }
}


For more information send a message to info at phpclasses dot org.