PHP Classes

File: tests/Parser/SoapClient/StructsTest.php

Recommend this page to a friend!
  Classes of WsdlToPhp   PHP SOAP Package Generator   tests/Parser/SoapClient/StructsTest.php   Download  
File: tests/Parser/SoapClient/StructsTest.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: issue-31 - #31: add unit test
Date: 8 years ago
Size: 1,697 bytes
 

Contents

Class file image Download
<?php

namespace WsdlToPhp\PackageGenerator\Tests\Parser\SoapClient;

use
WsdlToPhp\PackageGenerator\Parser\SoapClient\Structs;
use
WsdlToPhp\PackageGenerator\Model\Struct;

class
StructsTest extends SoapClientParser
{
   
/**
     *
     */
   
public function testWcf()
    {
       
$generator = self::getWcfInstance();

       
$parser = new Structs($generator);
       
$parser->parse();

       
$offer = $generator->getStruct('offer');

        if (
$offer instanceof Struct) {
           
$this->assertInstanceOf('\\WsdlToPhp\\PackageGenerator\\Model\\StructAttribute', $offer->getAttribute('offerClassMember'));
           
$this->assertInstanceOf('\\WsdlToPhp\\PackageGenerator\\Model\\StructAttribute', $offer->getAttribute('offer'));
           
$this->assertSame('offer', $offer->getAttribute('offer')->getType());
        } else {
           
$this->assertFalse(true, 'Unable to get offer struct');
        }

       
$order = $generator->getStruct('order');

        if (
$offer instanceof Struct) {
           
$this->assertInstanceOf('\\WsdlToPhp\\PackageGenerator\\Model\\StructAttribute', $order->getAttribute('orderClassMember'));
           
$this->assertInstanceOf('\\WsdlToPhp\\PackageGenerator\\Model\\StructAttribute', $order->getAttribute('order'));
           
$this->assertSame('order', $order->getAttribute('order')->getType());
        } else {
           
$this->assertFalse(true, 'Unable to get order struct');
        }
    }
   
/**
     *
     */
   
public function testLnp()
    {
       
$generator = self::getLnpInstance();

       
$parser = new Structs($generator);
       
$parser->parse();

       
$this->assertCount(0, $generator->getStructs());
    }
}