localheinz/phpunit-framework-constraint

Provides additional constraints and assertions for phpunit/phpunit

0.1.0 2018-10-05 08:05 UTC

README

Build Status codecov Latest Stable Version Total Downloads

Provides additional constraints for phpunit/phpunit.

Installation

Run

$ composer require localheinz/phpunit-framework-constraint

Usage

Import the Localheinz\PHPUnit\Framework\Constraint\Provider trait into your test class:

<?php

declare(strict_types=1);

namespace Foo\Bar\Test\Unit;

use Localheinz\PHPUnit\Framework\Constraint\Provider;
use PHPUnit\Framework\TestCase;

final class BazTest extends TestCase
{
    use Provider;
}

Assertions

In addition to the assertions made available by extending from PHPUnit\Framework\TestCase, the Provider trait provides the following assertions:

  • assertJsonStringSameAsJsonString(string $expected, string $actual, string $message = ''): void

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md.

License

This package is licensed using the MIT License.