Home

Awesome

PHPUnit Extra Constraints

Build Status AppVeyor Build Status Quality Gate Status Latest Stable Version Minimum PHP Version License PDS Skeleton

Installation

composer require --dev villfa/phpunit-extra-constraints

Usage

Here a basic example:

<?php
require_once 'vendor/autoload.php';

use PHPUnitExtraConstraints\Constraint\IsDate;

class ExampleTest extends PHPUnit\Framework\TestCase
{
    public function testDate(): void
    {
        $this->assertThat('2020-04-02', new IsDate('Y-m-d'));
    }
}

Available extra constraints

Tests

To validate and test the library:

composer run-script test

License

MIT

Other libraries proposing extra constraints