clippings/phpunit-extensions

This package is abandoned and no longer maintained. No replacement package was suggested.

Additional assertions and constraints for PHPUnit

0.1.0 2014-06-05 10:49 UTC

This package is not auto-updated.

Last update: 2020-01-20 03:52:02 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

Additional assertions and constraints for PHPUnit

Usage

assertArrayConstrained - is used to have a constriant for each entry in an array

use CL\PHPUnitExtensions\Constraint\ConstrainArray;

class ExampleTest extends PHPUnit_Framework_TestCase
{
    use ConstrainArrayTrait;

    public function testTest()
    {
        $this->assertArrayConstrained(
            array('test' => $this->equalTo('12')),
            array('test' => 12)
        );
    }
}

License

Copyright (c) 2014, Clippings Ltd. Developed by Ivan Kerin

Under BSD-3-Clause license, read LICENSE file.