PHPackages                             mracos/phpunit-run-failed - 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. mracos/phpunit-run-failed

ActivePhpunit-extension[Testing &amp; Quality](/categories/testing)

mracos/phpunit-run-failed
=========================

PHPUnit extension to re-run only failed tests

v0.0.1(7mo ago)12.1k↓29.2%MITPHPPHP ^8.1CI passing

Since Oct 1Pushed 7mo agoCompare

[ Source](https://github.com/mracos/phpunit-run-failed)[ Packagist](https://packagist.org/packages/mracos/phpunit-run-failed)[ RSS](/packages/mracos-phpunit-run-failed/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

PHPUnit Run Failed
==================

[](#phpunit-run-failed)

PHPUnit extension to re-run only failed tests.

Installation
------------

[](#installation)

```
composer require --dev mracos/phpunit-run-failed
```

Usage
-----

[](#usage)

### 1. Add Extension to PHPUnit Configuration

[](#1-add-extension-to-phpunit-configuration)

Add the extension to your `phpunit.xml`:

```

```

### 2. Ignore where we store the last failed tests

[](#2-ignore-where-we-store-the-last-failed-tests)

Failed test information is stored in `.phpunit-failed-tests.json` in your project root. Add this to your `.gitignore`:

```
.phpunit-failed-tests.json
```

### 3. Run Tests Normally

[](#3-run-tests-normally)

```
vendor/bin/phpunit
```

The extension automatically tracks any failed tests.

### 3. Re-run Only Failed Tests

[](#3-re-run-only-failed-tests)

Use PHPUnit's native `--testsuite` option:

```
vendor/bin/phpunit --testsuite=failed
```

Compatibility
-------------

[](#compatibility)

- **PHP**: 8.0+
- **PHPUnit**: 10.0+, 11.0+
- **Integration**: Works with existing PHPUnit configurations and other extensions

Test Project
------------

[](#test-project)

This repository includes a `test-project/` directory that serves as an integration test for the extension. It demonstrates how the extension works in a real PHPUnit environment.

### What is the Test Project?

[](#what-is-the-test-project)

The `test-project/` is a minimal PHP project that:

- Has its own `composer.json` with PHPUnit as a dependency
- Includes sample test files with intentionally failing tests
- Demonstrates the full extension workflow in isolation
- Serves as a reference implementation for integration

### How to Use the Test Project

[](#how-to-use-the-test-project)

1. **Navigate to the test project**:

    ```
    cd test-project
    ```
2. **Install dependencies** (automatically done):

    ```
    composer install
    ```
3. **Run the initial test suite** (creates failures):

    ```
    vendor/bin/phpunit
    ```

    This will run the tests with several intentional failures and errors:
4. **Test the --testsuite=failed functionality**:

    ```
    vendor/bin/phpunit --testsuite=failed
    ```

Should re-run only the failing tests.

5. Uncomment what makes the tests passes. Should see `No recorded failed tests found. Running empty test suite.`

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance62

Regular maintenance activity

Popularity23

Limited adoption so far

Community6

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

229d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25f9d171fce0cee1b5560cc6225defa71c0efa395343f26a2e5f54e25077703e?d=identicon)[mracos](/maintainers/mracos)

---

Top Contributors

[![mracos](https://avatars.githubusercontent.com/u/14015177?v=4)](https://github.com/mracos "mracos (11 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mracos-phpunit-run-failed/health.svg)

```
[![Health](https://phpackages.com/badges/mracos-phpunit-run-failed/health.svg)](https://phpackages.com/packages/mracos-phpunit-run-failed)
```

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)

PHPackages © 2026

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