PHP Classes

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

Recommend this page to a friend!
  Classes of WsdlToPhp   PHP SOAP Package Generator   tests/DomHandler/Wsdl/Tag/TagUnionTest.php   Download  
File: tests/DomHandler/Wsdl/Tag/TagUnionTest.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: 8 years ago
Size: 1,297 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;

class
TagUnionTest extends TestCase
{
   
/**
     *
     */
   
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);
    }
}