Skip to content
👓 Provides additional constraints and assertions for phpunit/phpunit
PHP Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dependabot
.github
src
test
.editorconfig
.gitattributes
.gitignore
.php_cs
CHANGELOG.md
LICENSE
Makefile
README.md
composer.json
composer.lock
infection.json
phpstan-baseline.neon
phpstan.neon
psalm-baseline.xml
psalm.xml

README.md

phpunit-framework-constraint

Continuous Deployment Continuous Integration Code Coverage Type Coverage Latest Stable Version Total Downloads

Provides additional constraints for phpunit/phpunit.

Installation

Run

$ composer require ergebnis/phpunit-framework-constraint

Usage

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

<?php

declare(strict_types=1);

namespace Foo\Bar\Test\Unit;

use Ergebnis\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 CODE_OF_CONDUCT.md.

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md.

License

This package is licensed using the MIT License.

You can’t perform that action at this time.