2017 © Pedro Peláez
 

package phpunit-testing-kit

Gives all the helper traits and classes that you will ever need to test a PHP application

image

avinash403/phpunit-testing-kit

Gives all the helper traits and classes that you will ever need to test a PHP application

  • Tuesday, June 12, 2018
  • by avinash403
  • Repository
  • 3 Watchers
  • 3 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHPunit testing kit

Collection of useful traits and classes that can be handy while testing a PHP application., (*1)

Installation by Composer

$ composer require avinash403/phpunit-testing-kit

Available Traits

Assertions

Contains some common assertions that is commonly used but PHPunit doesn't provide it., (*2)

USAGE, (*3)

use TestingKit\Assertions;
use PHPUnit\Framework\TestCase;

class ExampleTest extends TestCase
{
    use Assertions;

    public function test_exampleTest()
    {
        $this->assertAlpha('a');
    }
}

Available Assertions, (*4)

    * assertAlpha
    * assertNotAlpha
    * assertNumber
    * assertNotNumber
    * assertArrayHasKeys
    * assertStringContainsSubstring
    * assertStringNotContainsSubstring

PrivateAccess

Allows testing private and protected method and properties of a class., (*5)

USAGE, (*6)

use TestingKit\PrivateAccess;
use PHPUnit\Framework\TestCase;

class ExampleTest extends TestCase
{
    use PrivateAccess;

    public function test_exampleTest_forGettingPrivateMethod()
    {
        $classObject = new Class();

        //getting private method
        $methodResponse = $this->getPrivateMethod($classObject, 'exampleMethod', ['some text']);

        $this->assertEquals($methodResponse, 'some text');
    }
}

class ExampleClass
{
    private exampleMethod($someArgument)
    {
        return $someArgument;
    }
}

Available Features, (*7)

    * getPrivateMethod
    * setPrivateProperty
    * getPrivateProperty

Test

Run test by simply typing composer test from the root directory of this package., (*8)

Contribute on github

clone this repository( https://github.com/avinash403/laravel-dynamic-observer.git ), make your changes and raise a pull request to development branch, (*9)

The Versions

12/06 2018

dev-master

9999999-dev

Gives all the helper traits and classes that you will ever need to test a PHP application

  Sources   Download

OSL-1.0

The Development Requires

phpunit testing testing kit php testing

30/05 2018

v1.0.0

1.0.0.0

Gives all the helper traits and classes that you will ever need to test a PHP application

  Sources   Download

OSL-1.0

The Development Requires

phpunit testing testing kit php testing