PHP Classes

File: tests/Container/Model/StructAttributeContainerTest.php

Recommend this page to a friend!
  Classes of WsdlToPhp  >  PHP SOAP Package Generator  >  tests/Container/Model/StructAttributeContainerTest.php  >  Download  
File: tests/Container/Model/StructAttributeContainerTest.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: 6 years ago
Size: 1,839 bytes
 

Contents

Class file image Download
<?php

namespace WsdlToPhp\PackageGenerator\Tests\Container\Model;

use
WsdlToPhp\PackageGenerator\Tests\Model\StructTest;
use
WsdlToPhp\PackageGenerator\Model\StructAttribute;
use
WsdlToPhp\PackageGenerator\Container\Model\StructAttribute as StructAttributeContainer;
use
WsdlToPhp\PackageGenerator\Tests\TestCase;

class
StructAttributeContainerTest extends TestCase
{
   
/**
     * @return StructAttributeContainer
     */
   
public static function instance()
    {
       
$struct = StructTest::instance('Bar', true);
       
$structAttributeContainer = new StructAttributeContainer(self::getBingGeneratorInstance());
       
$structAttributeContainer->add(new StructAttribute(self::getBingGeneratorInstance(), 'foo', 'string', $struct));
       
$structAttributeContainer->add(new StructAttribute(self::getBingGeneratorInstance(), 'bar', 'int', $struct));
       
$structAttributeContainer->add(new StructAttribute(self::getBingGeneratorInstance(), 'Bar', 'float', $struct));
       
$structAttributeContainer->add(new StructAttribute(self::getBingGeneratorInstance(), 'fooBar', 'bool', $struct));
        return
$structAttributeContainer;
    }
   
/**
     *
     */
   
public function testGetStructAttributeByName()
    {
       
$structAttributeContainer = self::instance();

       
$this->assertInstanceOf('\\WsdlTophp\\PackageGenerator\\Model\\StructAttribute', $structAttributeContainer->getStructAttributeByName('foo'));
       
$this->assertInstanceOf('\\WsdlTophp\\PackageGenerator\\Model\\StructAttribute', $structAttributeContainer->getStructAttributeByName('bar'));
       
$this->assertInstanceOf('\\WsdlTophp\\PackageGenerator\\Model\\StructAttribute', $structAttributeContainer->getStructAttributeByName('fooBar'));
       
$this->assertNull($structAttributeContainer->getStructAttributeByName('foobar'));
    }
}

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