PHPackages                             edsonmedina/php\_testability - 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. edsonmedina/php\_testability

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

edsonmedina/php\_testability
============================

Analyses and reports testability issues of a php codebase

130148.8k↓42.9%9[36 issues](https://github.com/edsonmedina/php_testability/issues)[1 PRs](https://github.com/edsonmedina/php_testability/pulls)PHP

Since Oct 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/edsonmedina/php_testability)[ Packagist](https://packagist.org/packages/edsonmedina/php_testability)[ RSS](/packages/edsonmedina-php-testability/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/895488d8f92ae3b11dd6611d0a2908e3f77ed39e8fbca4b4b9eba2c1652bd485/68747470733a2f2f7472617669732d63692e6f72672f6564736f6e6d6564696e612f7068705f746573746162696c6974792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/edsonmedina/php_testability/)[![Code Climate](https://camo.githubusercontent.com/6328d0ea60efab4930a8ed8a7a1bebf34eb6a3b7f3ff3e8870e8a58b7e9ff016/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6564736f6e6d6564696e612f7068705f746573746162696c6974792f6261646765732f6770612e737667)](https://codeclimate.com/github/edsonmedina/php_testability)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e36098af591d621b6d57b240fee55f1bfa6b1828f99def23a98c639e853d0ff7/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6564736f6e6d6564696e612f7068705f746573746162696c6974792f6d61737465722e737667)](https://scrutinizer-ci.com/g/edsonmedina/php_testability/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/711240059b62becca7191c3d973fe03572b34ff8b75f72b6557f43457a81af43/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6564736f6e6d6564696e612f7068705f746573746162696c6974792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/edsonmedina/php_testability/?branch=master)[![Dependencies](https://camo.githubusercontent.com/74f2d372891cd8d84d400afd4083e3b85a11e8fe92031384dd87799319638744/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3534656462306235363732636666313265393030303030662f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/54edb0b5672cff12e900000f)

PHP\_Testability
================

[](#php_testability)

Analyses and produces a report with testability issues of a php codebase.

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

[](#installation)

PHP\_Testability requires at least PHP 7.0 to run.

### Composer

[](#composer)

Add `edsonmedina/php_testability` as a dependency to your project's `composer.json` file if you use [Composer](http://getcomposer.org/) to manage the dependencies of your project.

```
{
    "require-dev": {
        "edsonmedina/php_testability": "dev-master"
    }
}
```

And run `composer update`.

Or alternatively, just run:

```
composer require edsonmedina/php_testability "dev-master"
```

Usage
=====

[](#usage)

Analyse the current directory and generate an HTML report into report/

```
vendor/bin/testability . -o report
```

Exclude some directories

```
vendor/bin/testability . -x vendor,tmp,upload,config -o report
```

Check all the available options.

```
vendor/bin/testability --help
```

Results
=======

[](#results)

Open report/index.html on your browser. You shoule see something like this:

[![Screenshot](https://camo.githubusercontent.com/8b1040b6dff44b0d5bf97d4d3b94274da30ae4997faec5bd3f744805c083b585/687474703a2f2f7777772e6369616e65746f2e636f6d2f746573746162696c6974795f6469722e706e67)](https://camo.githubusercontent.com/8b1040b6dff44b0d5bf97d4d3b94274da30ae4997faec5bd3f744805c083b585/687474703a2f2f7777772e6369616e65746f2e636f6d2f746573746162696c6974795f6469722e706e67)

If you click on a file with issues, it'll show you a code browser and will highlight the lines with issues.

[![Screenshot](https://camo.githubusercontent.com/86e32585852e034c061094c2b40acc2304f4626a1ad77e322632891962cf0400/687474703a2f2f7777772e6369616e65746f2e636f6d2f746573746162696c6974795f66696c652e706e67)](https://camo.githubusercontent.com/86e32585852e034c061094c2b40acc2304f4626a1ad77e322632891962cf0400/687474703a2f2f7777772e6369616e65746f2e636f6d2f746573746162696c6974795f66696c652e706e67)

These are issues that hinder testability, such as:

- references to global variables, super globals, etc
- calls to functions that can't be mocked (like static methods or global functions)
- `new` instances of objects (tight coupling - can't be mocked/injected)
- ...and much more

Kudos to the brilliant [PHP-Parser](https://github.com/nikic/PHP-Parser/) (by nikic) on which PHP\_Testability relies heavily.

###  Health Score

33

—

LowBetter than 73% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.5% 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/5449?v=4)[Edson Medina](/maintainers/edsonmedina)[@edsonmedina](https://github.com/edsonmedina)

---

Top Contributors

[![edsonmedina](https://avatars.githubusercontent.com/u/5449?v=4)](https://github.com/edsonmedina "edsonmedina (362 commits)")[![Archanium](https://avatars.githubusercontent.com/u/295426?v=4)](https://github.com/Archanium "Archanium (1 commits)")[![CViniciusSDias](https://avatars.githubusercontent.com/u/6991415?v=4)](https://github.com/CViniciusSDias "CViniciusSDias (1 commits)")

---

Tags

analysesphpstatic-analysisunit-testing

### Embed Badge

![Health badge](/badges/edsonmedina-php-testability/health.svg)

```
[![Health](https://phpackages.com/badges/edsonmedina-php-testability/health.svg)](https://phpackages.com/packages/edsonmedina-php-testability)
```

###  Alternatives

[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

3309.4M1.2k](/packages/szepeviktor-phpstan-wordpress)[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M340](/packages/dms-phpunit-arraysubset-asserts)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3524.1M38](/packages/jasonmccreary-laravel-test-assertions)[orchestra/workbench

Workbench Companion for Laravel Packages Development

8219.1M67](/packages/orchestra-workbench)[soyuka/contexts

Behatch contexts

282.2M21](/packages/soyuka-contexts)[roquie/laravel-dusk-select2

Select2.js support for the Laravel Dusk testing.

41356.2k5](/packages/roquie-laravel-dusk-select2)

PHPackages © 2026

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