mhujer / consistence-phpunit
Add PHPUnit assert for Enums from consistence/consistence
Installs: 8 485
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ~8.1
- consistence-community/consistence: ~2.1
- phpunit/phpunit: ^10.1
Requires (Dev)
- consistence-community/coding-standard: 3.11.2
- phpstan/extension-installer: 1.1.0
- phpstan/phpstan: 1.8.5
- phpstan/phpstan-phpunit: 1.1.1
README
This library provides EnumAssert
PHPUnit assert for consistence/consistence enums.
Installation
$ composer require --dev mhujer/consistence-phpunit
Usage
-
use \Mhujer\ConsistencePhpunit\EnumAssert;
-
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 "Mhujer\ConsistencePhpunit\Fixtures\CardColor:red", but got "Mhujer\ConsistencePhpunit\Fixtures\CardColor:black }
Requirements
Works with PHP 8.1 or higher and PHPUnit 9.3 or higher.
Submitting bugs and feature requests
Bugs and feature request are tracked on GitHub
Author
Changelog
2.0.0 (2022-09-20)
- require PHP 8.1+
- add support for native enums to make migration easier
1.2.0 (2021-02-28)
- require PHP 7.4+
- allow PHP 8.0
- require PHPUnit 9.3+
1.1.0 (2020-02-07)
- allow PHPUnit 9
1.0.0 (2019-11-24)
- initial release