PHP Classes

File: tests/Model/StructValueTest.php

Recommend this page to a friend!
  Classes of WsdlToPhp   PHP SOAP Package Generator   tests/Model/StructValueTest.php   Download  
File: tests/Model/StructValueTest.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,246 bytes
 

Contents

Class file image Download
<?php

namespace WsdlToPhp\PackageGenerator\Tests\Model;

use
WsdlToPhp\PackageGenerator\Tests\TestCase;
use
WsdlToPhp\PackageGenerator\Model\StructValue;

class
StructValueTest extends TestCase
{
   
/**
     *
     */
   
public function testGetValue()
    {
       
$struct = StructTest::instance('Foot', true);
       
$struct->setIsRestriction(true);
       
$struct->addValue(1);
       
$struct->addValue('Bar');
       
$struct->addValue("5.3");

       
$this->assertSame(1, $struct->getValue(1)->getValue());
       
$this->assertNotSame("1", $struct->getValue(1)->getValue());
       
$this->assertSame('5.3', $struct->getValue("5.3")->getValue());
    }
   
/**
     * @expectedException \InvalidArgumentException
     */
   
public function testInvalidIndexValue()
    {
       
$struct = StructTest::instance('Foot', true);
        new
StructValue($struct->getGenerator(), 'foo', -1, $struct);
        new
StructValue($struct->getGenerator(), 'foo', 'bar', $struct);
    }
   
/**
     * @expectedException \InvalidArgumentException
     */
   
public function testSetInvalidIndexValue()
    {
       
$struct = StructTest::instance('Foot', true);
       
$struct->addValue(1);

       
$struct->getValue(1)->setIndex('1');
    }
}