PHPackages                             alorel/phpunit-auto-rerun - 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. alorel/phpunit-auto-rerun

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

alorel/phpunit-auto-rerun
=========================

Allows failed PHPUnit tests to automatically rerun.

0.2(8y ago)35.2k2[1 issues](https://github.com/Alorel/phpunit-auto-rerun/issues)3LGPL-2.1PHP

Since Jun 21Pushed 8y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (3)Versions (4)Used By (3)

[![Average time to resolve an issue](https://camo.githubusercontent.com/661fdcd20e31130730dc0a3d8b98f0ec73f32512d3b83934f72c0d0c14803e1e/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f616c6f72656c2f706870756e69742d6175746f2d726572756e2e737667)](http://isitmaintained.com/project/alorel/phpunit-auto-rerun "Average time to resolve an issue")[![Percentage of issues still open](https://camo.githubusercontent.com/fe4c6913d694ad2a7f62c8e4ddca2303719c3062c03067fd9265e12f65c6d830/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f6f70656e2f616c6f72656c2f706870756e69742d6175746f2d726572756e2e737667)](http://isitmaintained.com/project/alorel/phpunit-auto-rerun "Percentage of issues still open")[![Build Status](https://camo.githubusercontent.com/32e2939f2bf9405dfb19e2b797374c597377e89a8d3f980fc5a7890d66df1e30/68747470733a2f2f7472617669732d63692e6f72672f416c6f72656c2f706870756e69742d6175746f2d726572756e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Alorel/phpunit-auto-rerun)[![codecov](https://camo.githubusercontent.com/d2bffeb55f9c31ffd195c793902be6fe3692355dd6e16c16b40468c6f5d87e7e/68747470733a2f2f636f6465636f762e696f2f67682f416c6f72656c2f706870756e69742d6175746f2d726572756e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Alorel/phpunit-auto-rerun)[![Dependency Status](https://camo.githubusercontent.com/9f00ac63b92ac53d0894a9a1abfe3d1839b40a03bd661fb8392c45ccc2dce7b6/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3537363930393735666461626364303033643038363965332f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/57690975fdabcd003d0869e3)[![Reference Status](https://camo.githubusercontent.com/57f8f942aa5a129213f33f8e3d06b122cb9a3bcf053cebc16805216451401abc/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f616c6f72656c3a706870756e69742d6175746f2d726572756e2f7265666572656e63655f62616467652e737667)](https://www.versioneye.com/php/alorel:phpunit-auto-rerun/references)[![HHVM Status](https://camo.githubusercontent.com/0342d9e64b3d945c461433cd196810495a5529bc538fa04988c05b3d5eac9d31/687474703a2f2f6868766d2e683463632e64652f62616467652f616c6f72656c2f706870756e69742d6175746f2d726572756e2e737667)](http://hhvm.h4cc.de/package/alorel/phpunit-auto-rerun)

[![Latest Stable Version](https://camo.githubusercontent.com/89de18c73bb9dc3c195cf03fedf8afc261be871f20d2022f86fdcf5138be3fa1/68747470733a2f2f706f7365722e707567782e6f72672f616c6f72656c2f706870756e69742d6175746f2d726572756e2f762f737461626c65)](https://packagist.org/packages/alorel/phpunit-auto-rerun)[![Total Downloads](https://camo.githubusercontent.com/2dbaff746da236d4f86ca8800e09d0bd1152d0684c4662787d46d8d9d1f545d9/68747470733a2f2f706f7365722e707567782e6f72672f616c6f72656c2f706870756e69742d6175746f2d726572756e2f646f776e6c6f616473)](https://packagist.org/packages/alorel/phpunit-auto-rerun)[![License](https://camo.githubusercontent.com/67b685b5982ae0032cba2458b890687d0928aaeac63dc7bd7b55181eeed1bc08/68747470733a2f2f706f7365722e707567782e6f72672f616c6f72656c2f706870756e69742d6175746f2d726572756e2f6c6963656e7365)](https://packagist.org/packages/alorel/phpunit-auto-rerun)

---

Allows failed [PHPUnit](https://phpunit.de/) tests to automatically rerun.

Use cases
=========

[](#use-cases)

Anywhere where there is an external dependency which you don't have full control of, e.g. when developing an SDK for some API, which might apply rate limiting or experience brief downtime.

Requirements
============

[](#requirements)

- Tested on HHVM
- PHP 5.6 or 7.0+
- Tested on PHPUnit 5.4 (`require-dev ^5.0`), but might run on older versions (update your installation!)

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

[](#installation)

```
composer require --dev alorel/phpunit-auto-rerun
```

Usage
=====

[](#usage)

You can integrate retry functionality in your tests in one of two ways: using class inheritance or using traits.

In many situations, you can simply extend your test cases from `PHPUnit_Retriable_TestCase`, which itself extends the original `PHPUnit_Framework_TestCase`. Here, all you need to do is replace the class in your test cases:

```
