php-platform/restful-unit

v0.1.4 2018-04-15 08:27 UTC

This package is not auto-updated.

Last update: 2024-04-14 02:45:33 UTC


README

This package provides a utilities to unit test Restful Web Services from PHPPlatfrom/restful

How to Use

  • Step 1

refer to resources/autoload.php from this package in the phpunit.xml

<phpunit colors="true" bootstrap="vendor/php-platform/restful-unit/resources/autoload.php" >
</phpunit>
  • Step 2

invoke setupMethodds of PhpPlatform\Tests\RestfulUnit\ServiceTestCase from the TestCase's setup methods

class MyRestFulTest extends TestCase {
    static function setUpBeforeClass(){
        parent::setUpBeforeClass();
        \PhpPlatform\Tests\RestfulUnit\ServiceTestCase::setUpBeforeClass();
    }
    
    function setUp(){
        parent::setUp();
        \PhpPlatform\Tests\RestfulUnit\ServiceTestCase::setUp();
    }
    
    static function tearDownAfterClass(){
        parent::tearDownAfterClass();
        \PhpPlatform\Tests\RestfulUnit\ServiceTestCase::tearDownAfterClass();
    }
    
    function tearDown(){
        parent::tearDown();
        \PhpPlatform\Tests\RestfulUnit\ServiceTestCase::tearDown();
    }
}