PHPackages                             mhujer/consistence-phpunit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. mhujer/consistence-phpunit

ActiveLibrary[Testing &amp; Quality](/categories/testing)

mhujer/consistence-phpunit
==========================

Add PHPUnit assert for Enums from consistence/consistence

2.1(3y ago)314.6k↓50%MITPHPPHP ~8.1

Since Nov 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mhujer/consistence-phpunit)[ Packagist](https://packagist.org/packages/mhujer/consistence-phpunit)[ Docs](https://github.com/mhujer/consistence-phpunit)[ RSS](/packages/mhujer-consistence-phpunit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (6)Used By (0)

Consistence PHPUnit adds Assert for Enums from consistence/consistence
======================================================================

[](#consistence-phpunit-adds-assert-for-enums-from-consistenceconsistence)

[![Build Status](https://camo.githubusercontent.com/34e2b0e624ed1c6dfafdccaf3cc342abd43f1b2dada0130851fd42a94622de34/68747470733a2f2f7472617669732d63692e6f72672f6d68756a65722f636f6e73697374656e63652d706870756e69742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mhujer/consistence-phpunit) [![Latest Stable Version](https://camo.githubusercontent.com/218f2cee0a28e05e3ddfb2185bf86be75c59204fed660d69ed07119d90b434cb/68747470733a2f2f706f7365722e707567782e6f72672f6d68756a65722f636f6e73697374656e63652d706870756e69742f76657273696f6e2e706e67)](https://packagist.org/packages/mhujer/consistence-phpunit) [![Total Downloads](https://camo.githubusercontent.com/00215ebf115c5179cf1e323d3b7bc33ca2e1740c374a92bb3922261f2f6c5795/68747470733a2f2f706f7365722e707567782e6f72672f6d68756a65722f636f6e73697374656e63652d706870756e69742f646f776e6c6f6164732e706e67)](https://packagist.org/packages/mhujer/consistence-phpunit) [![License](https://camo.githubusercontent.com/a4723849bfddd7b9e265c3fcd6b93125f14ac1ac4ab836b02982df2651924f9a/68747470733a2f2f706f7365722e707567782e6f72672f6d68756a65722f636f6e73697374656e63652d706870756e69742f6c6963656e73652e737667)](https://packagist.org/packages/mhujer/consistence-phpunit) [![Coverage Status](https://camo.githubusercontent.com/e74e84eb413e5aabf70e57178ac5c4301e6e0c47c8e10d672114b4165df46338/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d68756a65722f636f6e73697374656e63652d706870756e69742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/mhujer/consistence-phpunit?branch=master)

This library provides `EnumAssert` PHPUnit assert for [consistence/consistence](https://github.com/consistence/consistence) enums.

Installation
============

[](#installation)

```
$ composer require --dev mhujer/consistence-phpunit
```

Usage
=====

[](#usage)

1. `use \Mhujer\ConsistencePhpunit\EnumAssert;`
2. 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
============

[](#requirements)

Works with PHP 8.1 or higher and PHPUnit 9.3 or higher.

Submitting bugs and feature requests
====================================

[](#submitting-bugs-and-feature-requests)

Bugs and feature request are tracked on [GitHub](https://github.com/mhujer/consistence-phpunit/issues)

Author
======

[](#author)

[Martin Hujer](https://www.martinhujer.cz)

Changelog
=========

[](#changelog)

2.0.0 (2022-09-20)
==================

[](#200-2022-09-20)

- require PHP 8.1+
- add support for native enums to make migration easier

1.2.0 (2021-02-28)
==================

[](#120-2021-02-28)

- require PHP 7.4+
- allow PHP 8.0
- require PHPUnit 9.3+

1.1.0 (2020-02-07)
------------------

[](#110-2020-02-07)

- allow PHPUnit 9

1.0.0 (2019-11-24)
------------------

[](#100-2019-11-24)

- initial release

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~310 days

Total

5

Last Release

1124d ago

Major Versions

1.2.0 → 2.0.02022-09-20

PHP version history (3 changes)1.0.0PHP ~7.3

1.2.0PHP ~7.4 | ~8.0

2.0.0PHP ~8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b232da7cbc1f54c8230ffac0c734a0e685743790ababfc00bf5913bc0bc723db?d=identicon)[mhujer](/maintainers/mhujer)

---

Top Contributors

[![mhujer](https://avatars.githubusercontent.com/u/353372?v=4)](https://github.com/mhujer "mhujer (21 commits)")

---

Tags

assertenumphpphpunitphpunitenumassertenumsconsistence

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mhujer-consistence-phpunit/health.svg)

```
[![Health](https://phpackages.com/badges/mhujer-consistence-phpunit/health.svg)](https://phpackages.com/packages/mhujer-consistence-phpunit)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69617.9M510](/packages/spatie-phpunit-snapshot-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[elliotchance/concise

Concise is test framework for using plain English and minimal code, built on PHPUnit.

45223.8k4](/packages/elliotchance-concise)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[meyfa/phpunit-assert-gd

PHPUnit matcher/assertions for GD image resources

12553.6k12](/packages/meyfa-phpunit-assert-gd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
