PHP Classes

File: test/ssa/runner/ServiceMetadataTest.php

Recommend this page to a friend!
  Packages of thomas   SSA   test/ssa/runner/ServiceMetadataTest.php   Download  
File: test/ssa/runner/ServiceMetadataTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: SSA
Call PHP classes from JavaScript on Web pages
Author: By
Last change:
Date: 12 years ago
Size: 1,095 bytes
 

 

Contents

Class file image Download
<?php

namespace ssa\runner;

use ssa\ServiceMetadata;
/**
 * Description of ServiceRunnerTest
 *
 * @author thomas
 */
class ServiceMetadataTest extends \PHPUnit_Framework_TestCase{
    
    public function testContructWithStringClass() {
        $service = new ServiceMetadata(
            'testPhpUnit',
            '\PHPUnit_Framework_TestCase',
            array()
        );
        $this->assertEquals('testPhpUnit', $service->getServiceName());
        $this->assertEquals('PHPUnit_Framework_TestCase', $service->getClass()->getName());
        $this->assertEquals(array(), $service->getMethods());
    }
    
    public function testContructWithReflectionClass() {
        $service = new ServiceMetadata(
            'testPhpUnit',
            new \ReflectionClass('\PHPUnit_Framework_TestCase'),
            array('assertTrue')
        );
        $this->assertEquals('testPhpUnit', $service->getServiceName());
        $this->assertEquals('PHPUnit_Framework_TestCase', $service->getClass()->getName());
        $this->assertEquals(array('assertTrue'), $service->getMethods());
    }
}