Login   Register  
PHP Classes
elePHPant
Icontem

File: tests/PHP2WSDL/Tests/PHP2WSDLTest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Protung Dragos  >  PHP WSDL Generator  >  tests/PHP2WSDL/Tests/PHP2WSDLTest.php  >  Download  
File: tests/PHP2WSDL/Tests/PHP2WSDLTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHP WSDL Generator
Generate WSDL from PHP classes code
Author: By
Last change:
Date: 1 year ago
Size: 969 bytes
 

Contents

Class file image Download
<?php

namespace PHP2WSDL\Tests;

use 
DirectoryIterator;
use 
PHP2WSDL\PHPClass2WSDL;

class 
PHP2WSDLTest extends \PHPUnit_Framework_TestCase {

    public function 
dataProviderPHP2WSDL() {
        
$data = array();
        
        
$dir = new DirectoryIterator(__DIR__ '/Fixtures');
        foreach (
$dir as $fileinfo) {
            if (
$fileinfo->isFile()) {
                
$basename $fileinfo->getBasename('.php');
                
$withAnnotation strpos($basename'WithAnnotations');
                
$data[] = array('PHP2WSDL\Tests\Fixtures\\' $basenamefile_get_contents(__DIR__ '/Expected/' $basename '.wsdl'), $withAnnotation);
            }
        }
        
        return 
$data;
    }

    
/**
     * @dataProvider dataProviderPHP2WSDL
     */
    
public function testPHP2WSDL($class$expected$withAnnotation) {
        
$wsdlGenerator = new PHPClass2WSDL($class'localhost');
        
$wsdlGenerator->generateWSDL($withAnnotation);
        
$actual $wsdlGenerator->dump();
        
$this->assertEquals($expected$actual);
    }
}