consistence phpunit
1.0.0
This library provides EnumAssert
PHPUnit assert for consistence/consistence enums.
$ composer require --dev mhujer/consistence-phpunit
use MhujerConsistencePhpunitEnumAssert;
use the assert this way:
EnumAssert::assertSame($expectedEnum, $actualEnum);
e.g.
public function testEnumsAreSame(): void{ EnumAssert::assertSame(CardColor::get(CardColor::RED), CardColor::get(CardColor::BLACK));// Expected "MhujerConsistencePhpunitFixturesCardColor:red", but got "MhujerConsistencePhpunitFixturesCardColor:black}
Works with PHP 8.1 or higher and PHPUnit 9.3 or higher.
Bugs and feature request are tracked on GitHub
Martin Hujer
require PHP 8.1+
add support for native enums to make migration easier
require PHP 7.4+
allow PHP 8.0
require PHPUnit 9.3+
allow PHPUnit 9
initial release