PHP Classes

File: tests/Parser/Wsdl/TagExtensionTest.php

Recommend this page to a friend!
  Classes of WsdlToPhp   PHP SOAP Package Generator   tests/Parser/Wsdl/TagExtensionTest.php   Download  
File: tests/Parser/Wsdl/TagExtensionTest.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: 2,257 bytes
 

Contents

Class file image Download
<?php

namespace WsdlToPhp\PackageGenerator\Tests\Parser\Wsdl;

use
WsdlToPhp\PackageGenerator\Parser\Wsdl\TagExtension;
use
WsdlToPhp\PackageGenerator\Model\Struct;

class
TagExtensionTest extends WsdlParser
{
   
/**
     * @return \WsdlToPhp\PackageGenerator\Parser\Wsdl\TagExtension
     */
   
public static function ebayInstance()
    {
        return new
TagExtension(self::generatorInstance(self::wsdlEbayPath()));
    }
   
/**
     * @return \WsdlToPhp\PackageGenerator\Parser\Wsdl\TagExtension
     */
   
public static function wcfInstance()
    {
        return new
TagExtension(self::generatorInstance(self::wsdlWcfPath()));
    }
   
/**
     *
     */
   
public function testParseEbay()
    {
       
$tagEnumerationParser = self::ebayInstance();

       
$tagEnumerationParser->parse();

       
$count = 0;
       
$structs = $tagEnumerationParser->getGenerator()->getStructs();
        if (
$structs->count() > 0) {
            if (
$structs->getStructByName('AddDisputeRequestType') instanceof Struct) {
               
$this->assertSame('AbstractRequestType', $structs->getStructByName('AddDisputeRequestType')->getInheritance());
               
$count++;
            }
            if (
$structs->getStructByName('TaxIdentifierAttributeType') instanceof Struct) {
               
$this->assertSame('string', $structs->getStructByName('TaxIdentifierAttributeType')->getInheritance());
               
$count++;
            }
        }
       
$this->assertSame(2, $count);
    }
   
/**
     *
     */
   
public function testParseWcf()
    {
       
$tagEnumerationParser = self::wcfInstance();

       
$tagEnumerationParser->parse();

       
$count = 0;
       
$structs = $tagEnumerationParser->getGenerator()->getStructs();
        if (
$structs->count() > 0) {
            if (
$structs->getStructByName('offer') instanceof Struct) {
               
$this->assertSame('order', $structs->getStructByName('offer')->getInheritance());
               
$count++;
            }
            if (
$structs->getStructByName('order') instanceof Struct) {
               
$this->assertSame('', $structs->getStructByName('order')->getInheritance());
               
$count++;
            }
        }
       
$this->assertSame(2, $count);
    }
}