File: tests/File/ComposerTest.php

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

Contents

Class file image Download
<?php

namespace WsdlToPhp\PackageGenerator\Tests\File;

use
WsdlToPhp\PackageGenerator\File\Composer;

class
ComposerTest extends AbstractFile
{
   
/**
     *
     */
   
public function testBing()
    {
       
$instance = clone self::getBingGeneratorInstance();
       
$instance
           
->setOptionPrefix('Api')
            ->
setOptionComposerName('wsdltophp/bing');
       
$composerFile = new Composer($instance, 'composer');
       
$composerFile
           
->setRunComposerUpdate(false)
            ->
write();

       
$this->assertSameFileContent('ValidBingComposer' . (version_compare(PHP_VERSION, '5.4.0') === -1 ? '.php53' : ''), $composerFile, 'json');
    }
   
/**
     *
     */
   
public function testSetRunComposerUdpate()
    {
       
$instance = clone self::getBingGeneratorInstance();
       
$instance
           
->setOptionPrefix('Api');
       
$composerFile = new Composer($instance, 'composer');
       
$composerFile->setRunComposerUpdate(false);

       
$this->assertFalse($composerFile->getRunComposerUpdate());
    }
   
/**
     *
     */
   
public function testGetFileName()
    {
       
$instance = clone self::getBingGeneratorInstance();
       
$instance->setOptionPrefix('Api');
       
$composerFile = new Composer($instance, 'composer');

       
$this->assertSame(self::getTestDirectory() . 'composer.json', $composerFile->getFileName());
    }
}


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