2017 © Pedro Peláez
 

library functional-tester

This is a library for functional test of PHP legacy products

image

kazu9su/functional-tester

This is a library for functional test of PHP legacy products

  • Tuesday, January 17, 2017
  • by kazu9su
  • Repository
  • 1 Watchers
  • 7 Stars
  • 7,908 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

FunctionalTester library

Build Status, (*1)

This is a library for functional test of PHP legacy products.
If you have difficulty with testing such products, this library can help you., (*2)

Usage

First, create a new "FunctionalTester" instance., (*3)

You can set session, document root and include paths used in your target product., (*4)

If you call request method like http request, you can get a parsed response instance of GuzzleHttp\Message\Response, (*5)

use FunctionalTester/FunctionalTester;

class IndexTest extends PHPUnit_Framework_TestCase
{
    public function testIndex
    {
        $tester = new FunctionalTester();

        //set session used in your target product.
        $tester->setSession(['id' => 'hogehoge']);

        //set your document root. you can also set as constructer 1st argument.
        $tester->setDocumentRoot('/path/to/src');

        //set include path used in your target product. you can also set as constructer 2nd argument.
        $tester->setIncludePath('.:/usr/bin/php');

        //you can also add
        $tester->addIncludePath(':/path/to/src');

        //you can call get or post method like http request
        $response = $tester->get('index.php', ['username' => 'hogehoge']);

        //you can assert request results like this.
        $this->assertEquals(200, $response->getStatusCode());
        $this->assertEquals('OK', $response->getBody());
    }
}

Installation

You can install this library through Composer ., (*6)

$ composer require kazu9su/functional-tester

This will install FunctionalTester and all required dependencies., (*7)

Tests

To execute the test suite, you'll need phpunit., (*8)

$ phpunit

License

The FunctionalTester is licensed under the MIT license. See License File for more information., (*9)

The Versions

17/01 2017

dev-master

9999999-dev https://github.com/kazu9su/Test

This is a library for functional test of PHP legacy products

  Sources   Download

MIT

The Requires

 

The Development Requires

api micro framework router

19/03 2016

dev-cookie-factory

dev-cookie-factory https://github.com/kazu9su/Test

This is a library for functional test of PHP legacy products

  Sources   Download

MIT

The Requires

 

The Development Requires

api micro framework router

13/03 2016

dev-use-guzzle-5-3-0

dev-use-guzzle-5-3-0 https://github.com/kazu9su/Test

This is a library for functional test of PHP legacy products

  Sources   Download

MIT

The Requires

 

The Development Requires

api micro framework router

05/03 2016

dev-response-object

dev-response-object https://github.com/kazu9su/Test

This is a library for functional test of PHP legacy products

  Sources   Download

MIT

The Requires

 

The Development Requires

api micro framework router

15/01 2016

0.0.2

0.0.2.0 https://github.com/kazu9su/Test

This is a library for functional test of PHP legacy products

  Sources   Download

MIT

The Requires

 

The Development Requires

api micro framework router

22/12 2015

0.0.1

0.0.1.0 https://github.com/kazu9su/Test

This is a library for functional test of PHP legacy products

  Sources   Download

MIT

The Requires

 

The Development Requires

api micro framework router