Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.39 KB

File metadata and controls

55 lines (39 loc) · 1.39 KB

Installation

Requirements

PHP >= 7.1 is required.

PHPUnit >= 6.0 is required but PHPUnit >= 6.2 is recommended.

Getting Started

Run the following command to add PHPUnit Tester to your project's composer.json. See Packagist for specific versions.

composer require php-kitchen/code-specs

Or you can copy this library from:

Then you can use PHPUnit Tester in your test simply extending from Specification class. Example:

use PHPKitchen\CodeSpecs\Base\Specification;

class YourTest extends Specification {

    public function testSomeMethod() {
        $I = $this->tester;
        ......
        $I->lookAt('my dummy variable');
        $I->seeBool(true)->isFalse();
    }
}

or by using "TesterInitialization" trait in your test case

use PHPUnit\Framework\TestCase;
use PHPKitchen\CodeSpecs\Mixin\TesterInitialization;

class YourTest extends TestCase {
    use TesterInitialization;

    public function testSomeMethod() {
        $I = $this->tester;
        ......
        $I->lookAt('my dummy variable');
        $I->seeBool(true)->isFalse();
    }
}

If you want to use CodeSpecs with Codeception, read Codeception installation guide.