PHP Classes

File: tests/ConfigurationReader/XsdTypesTest.php

Recommend this page to a friend!
  Classes of WsdlToPhp   PHP SOAP Package Generator   tests/ConfigurationReader/XsdTypesTest.php   Download  
File: tests/ConfigurationReader/XsdTypesTest.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: 9 years ago
Size: 1,333 bytes
 

Contents

Class file image Download
<?php

namespace WsdlToPhp\PackageGenerator\Tests\ConfigurationReader;

use
WsdlToPhp\PackageGenerator\Tests\TestCase;
use
WsdlToPhp\PackageGenerator\ConfigurationReader\XsdTypes;

class
XsdTypesTest extends TestCase
{
   
/**
     * @return XsdTypes
     */
   
public static function instance()
    {
        return
XsdTypes::instance(__DIR__ . '/../resources/xsd_types.yml');
    }
   
/**
     * @expectedException InvalidArgumentException
     */
   
public function testException()
    {
       
XsdTypes::instance(__DIR__ . '/../resources/bad_xsd_types.yml');
    }
   
/**
     * @expectedException InvalidArgumentException
     */
   
public function testExceptionForUnexistingFile()
    {
       
XsdTypes::instance(__DIR__ . '/../resources/bad_xsd_types');
    }
   
/**
     *
     */
   
public function testIsXsdTrue()
    {
       
$this->assertTrue(self::instance()->isXsd('duration'));
    }
   
/**
     *
     */
   
public function testIsXsdFalse()
    {
       
$this->assertFalse(self::instance()->isXsd('Duration'));
    }
   
/**
     *
     */
   
public function testPhpXsd()
    {
       
$this->assertSame('string', self::instance()->phpType('duration'));
    }
   
/**
     *
     */
   
public function testPhpNonXsd()
    {
       
$this->assertSame('', self::instance()->phpType('Duration'));
    }
}