PHPackages                             flaptasticapps/flaptastic - 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. flaptasticapps/flaptastic

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

flaptasticapps/flaptastic
=========================

Flaptastic py.test plugin.

7.0.3(7y ago)015[1 PRs](https://github.com/FlaptasticApps/phpunit-flaptastic/pulls)WTFPLPHPPHP &gt;=7.1.0

Since Nov 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/FlaptasticApps/phpunit-flaptastic)[ Packagist](https://packagist.org/packages/flaptasticapps/flaptastic)[ Docs](https://github.com/FlaptasticApps/phpunit-flaptastic)[ RSS](/packages/flaptasticapps-flaptastic/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (2)Versions (24)Used By (0)

phpunit-flaptastic
==================

[](#phpunit-flaptastic)

[Flaptastic](https://www.flaptastic.com/) helps stop test flapping in your CICD environment such as CircleCI, TravisCI, or Jenkins. This project is registered on packagist  allowing you to easily install it with composer.

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

[](#installation)

pytest-flaptastic is installable via [Composer](http://getcomposer.org) and should be added as a `require-dev` dependency:

```
composer require --dev flaptasticapps/flaptastic

```

Integrating with your codebase
------------------------------

[](#integrating-with-your-codebase)

Enable Flaptastic's autoloader in your PHPUnit `phpunit.xml` file like this:

```

...

```

To allow Flaptastic the ability to disable (aka skip) tests instantly in your CI system, you should add the following trait to all of your TestCase classes, or even simpler, just once to your base TestCase if your tests all extend from a common base TestCase.

*Note that PHP Trait 'use' statements must go **inside** your TestCase class.*

```
use FlaptasticApps\PHPUnit\Listener\FlaptasticDisableableTest;

```

Finally, configure your CI environment with the correct environment variables as seen below.

Environment Variables Configuration for CI
------------------------------------------

[](#environment-variables-configuration-for-ci)

RequiredEnvironment Variable NameDescriptionYesFLAPTASTIC\_ORGANIZATION\_IDOrganization idYesFLAPTASTIC\_API\_TOKENAPI tokenYesFLAPTASTIC\_SERVICEName of service (aka microservice name) under testNoFLAPTASTIC\_BRANCHBranch name being tested. In git, you might pass "master" or names like "myFeature". (CI systems like Circle have special variables that expose this value.)NoFLAPTASTIC\_COMMIT\_IDVersion id of code tested. In git, this would be the commit sha. (CI systems like Circle have special variables that expose this value.)NoFLAPTASTIC\_LINKLink to CI (Jenkins/Circle/Travis etc) website page where you can find the full details of the test run, if applicable. (CI systems like Circle have special variables that expose this value.)NoFLAPTASTIC\_VERBOSITYStdout verbosity. 0=none (default) 1=minimal 2=everythingCircleCI 2.0 Configuration
--------------------------

[](#circleci-20-configuration)

A simple project might have a CircleCI 2.0 YML that ultimately does a 'make test' like this:

```
      - run: make test

```

In CircleCI 2.0, we must map some of Circle's variables to Flaptastic varibles and include the Flaptastic organization id like this:

```
      - run:
          name: Run PHPUnit With Flaptastic
          environment:
            FLAPTASTIC_ORGANIZATION_ID: ""
            FLAPTASTIC_VERBOSITY: 1
          command: |
            echo 'export FLAPTASTIC_BRANCH=$CIRCLE_BRANCH' >> $BASH_ENV
            echo 'export FLAPTASTIC_LINK=$CIRCLE_BUILD_URL' >> $BASH_ENV
            echo 'export FLAPTASTIC_SERVICE=$CIRCLE_PROJECT_REPONAME' >> $BASH_ENV
            echo 'export FLAPTASTIC_COMMIT_ID=$CIRCLE_SHA1' >> $BASH_ENV
            source $BASH_ENV
            make test

```

Please be sure to pass your selected organization ID as the actual ID value from your Flaptastic account as a string with double quotes. At the time of this writing, CircleCI will botch our 64-bit integer ids without the double quotes.

Finally, find your Flaptastic API token and then go to your CircleCI project page. Navigate to the project environment variables screen and create an enviornment variable called "FLAPTASTIC\_API\_TOKEN" and then paste your token as the value.

[![alt text](https://camo.githubusercontent.com/0c56a2e3f48b745cc96e3485c59f28670be32dd829332920f38a18cf0980196f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f7777772e666c61707461737469632e636f6d2f696d616765732f636972636c652e706e67 "Screenshot of how to register the secret token value in CircleCI")](https://camo.githubusercontent.com/0c56a2e3f48b745cc96e3485c59f28670be32dd829332920f38a18cf0980196f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f7777772e666c61707461737469632e636f6d2f696d616765732f636972636c652e706e67)

Testing
-------

[](#testing)

Run tests using Docker.

1. Install Docker on your machine
2. Build the image: `docker build -t phpunit-flaptastic .`
3. Run tests: `docker run -it --rm phpunit-flaptastic`

License
-------

[](#license)

phpunit-flaptastic is available under the MIT License.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 97.2% 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 ~6 days

Recently: every ~18 days

Total

21

Last Release

2601d ago

Major Versions

0.1.9 → 7.0.02018-12-18

0.1.12 → 4.8.362019-01-18

4.8.36 → 7.0.12019-01-20

4.8.37 → 7.0.22019-01-20

4.8.38 → 7.0.32019-04-01

PHP version history (2 changes)0.0.1PHP &gt;=7.1.0

4.8.36PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f39331036e6186fe4578adbb075c3b637643c2841d0c3336f2fa5429d7c3f71?d=identicon)[flaptastic](/maintainers/flaptastic)

---

Top Contributors

[![blockjon](https://avatars.githubusercontent.com/u/1198745?v=4)](https://github.com/blockjon "blockjon (35 commits)")[![kaiku](https://avatars.githubusercontent.com/u/1470390?v=4)](https://github.com/kaiku "kaiku (1 commits)")

---

Tags

phpunitassertionlistener

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/flaptasticapps-flaptastic/health.svg)

```
[![Health](https://phpackages.com/badges/flaptasticapps-flaptastic/health.svg)](https://phpackages.com/packages/flaptasticapps-flaptastic)
```

###  Alternatives

[zenstruck/assert

Standalone, lightweight, framework agnostic, test assertion library.

8114.9M8](/packages/zenstruck-assert)[fr3d/swagger-assertions

Test your API requests and responses against your swagger definition

138850.9k5](/packages/fr3d-swagger-assertions)[blastcloud/guzzler

Supercharge your app or SDK with a testing library specifically for Guzzle.

272419.3k35](/packages/blastcloud-guzzler)[elliotchance/concise

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

45223.8k4](/packages/elliotchance-concise)[matthiasnoback/phpunit-asynchronicity

Library for asserting things that happen asynchronously with PHPUnit

36229.0k7](/packages/matthiasnoback-phpunit-asynchronicity)[code-distortion/adapt

A Laravel package that builds databases for your tests, improving their speed.

2835.5k](/packages/code-distortion-adapt)

PHPackages © 2026

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