ghostwriter/psr-phpunit-assertions

PHPUnit assertions for PSR-compliant components, implemented as reusable traits.

0.1.x-dev 2025-03-12 04:04 UTC

This package is auto-updated.

Last update: 2025-03-12 04:05:03 UTC


README

GitHub Sponsors Automation Supported PHP Version Downloads

PHPUnit assertions for PSR-compliant components, implemented as reusable traits.

Warning

This project is not finished yet, work in progress.

Installation

You can install the package via composer:

composer require ghostwriter/psr-phpunit-assertions --dev

Star ⭐️ this repo if you find it useful

You can also star (🌟) this repo to find it easier later.

Usage

<?php

declare(strict_types=1);

// use all the traits provided

use \Ghostwriter\PsrPhpunitAssertions\AssertionsTrait;

final class ExampleOneTest extends AbstractTestCase
{
    use AssertionsTrait;
}

// or mix and match the trait you need.

use \Ghostwriter\PsrPhpunitAssertions\CacheTrait;
use \Ghostwriter\PsrPhpunitAssertions\ClockTrait;
use \Ghostwriter\PsrPhpunitAssertions\ContainerTrait;
use \Ghostwriter\PsrPhpunitAssertions\EventDispatcherTrait;
use \Ghostwriter\PsrPhpunitAssertions\HttpTrait;
use \Ghostwriter\PsrPhpunitAssertions\LinkTrait;
use \Ghostwriter\PsrPhpunitAssertions\LogTrait;
use \Ghostwriter\PsrPhpunitAssertions\SimpleCacheTrait;

final class ExampleTest extends AbstractTestCase
{
    use CacheTrait;
    use ClockTrait;
    use ContainerTrait;
    use EventDispatcherTrait;
    use HttpTrait;
    use LinkTrait;
    use LogTrait;
    use SimpleCacheTrait;
}

Docs

Please see docs/README.md

Credits

Changelog

Please see CHANGELOG.md for more information on what has changed recently.

License

Please see LICENSE for more information on the license that applies to this project.

Security

Please see SECURITY.md for more information on security disclosure process.