PHPackages                             ozh/phpunit-overassertive - 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. ozh/phpunit-overassertive

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

ozh/phpunit-overassertive
=========================

Find over assertive tests in your PHPUnit test suite

114.6kPHP

Since Mar 25Pushed 6y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

phpunit-overassertive
=====================

[](#phpunit-overassertive)

Having several assertions in the same test is fine, but when an assertion fails, the whole test aborts and other assertions in the same test are not tested.

Depending on what you test and how you coded it, you may want to split some tests in several sub tests.

**OverAssertive** is a PHPUnit extension that reports right in the console which tests have "too many" assertions, where "too many" is what you define, to help you inspect and maybe refactor some tests.

[![overassertive](https://cloud.githubusercontent.com/assets/223647/7969423/0d90aaee-0a37-11e5-9f40-a7d29c613017.png)](https://cloud.githubusercontent.com/assets/223647/7969423/0d90aaee-0a37-11e5-9f40-a7d29c613017.png)

Usage
-----

[](#usage)

Enable it with all defaults by adding the following to your test suite's `phpunit.xml` file:

```

...

```

If you're not using an autoloader you can also specify the library location:

```

...

```

Now run your test suite as normal. OverAssertive will report over assertive tests in the console after the suite completes.

Configuration
-------------

[](#configuration)

OverAssertive has two configurable parameters:

- **alertThreshold** - Number of assertions that will make a test over assertive (default: 10 assertions)
- **reportLength** - Number of over assertive tests included in the report (default: 10 tests)

These configuration parameters are set in `phpunit.xml` when adding the listener:

```

                        10

                        10

```

Inspiration
-----------

[](#inspiration)

Much thanks to [phpunit-speedtrap](https://github.com/johnkary/phpunit-speedtrap)

License
-------

[](#license)

Do whatever the hell you want to.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/223647?v=4)[྅༻ Ǭɀħ ༄༆ཉ](/maintainers/ozh)[@ozh](https://github.com/ozh)

---

Top Contributors

[![ozh](https://avatars.githubusercontent.com/u/223647?v=4)](https://github.com/ozh "ozh (5 commits)")

---

Tags

assertionsextensionphpunit

### Embed Badge

![Health badge](/badges/ozh-phpunit-overassertive/health.svg)

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

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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