PHPackages                             padraic/phpspec-extensions - 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. padraic/phpspec-extensions

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

padraic/phpspec-extensions
==========================

Collection of Listeners to log spec times, prioritise specs, and free memory after each spec

39442PHP

Since Feb 1Pushed 9y ago7 watchersCompare

[ Source](https://github.com/humbug/phpspec-extensions)[ Packagist](https://packagist.org/packages/padraic/phpspec-extensions)[ RSS](/packages/padraic-phpspec-extensions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Humbug PHPSpec Extensions
=========================

[](#humbug-phpspec-extensions)

A collection of extensions intended to allow for:

- Timing of specification and example execution
- Freeing of memory by removing specification properties after execution
- Filter/Reorder both specifications and examples using custom filters

Available phpspec.yml options (see usable examples below):

```
formatter.name: pretty
humbug.filtered_resource_loader.filters:
- Humbug\PhpSpec\Loader\Filter\Specification\FastestFirstFilter
- Humbug\PhpSpec\Loader\Filter\Specification\ShuffleFilter
- Humbug\PhpSpec\Loader\Filter\Example\ShuffleFilter
humbug.time_collector.target: /tmp/phpspec.times.humbug.json
extensions:
- Humbug\PhpSpec\TimeCollectorExtension
- Humbug\PhpSpec\FilteredResourceLoaderExtension
- Humbug\PhpSpec\FreeMemoryExtension
```

This is for illustrative purposes only to show all options. See the usage examples below for working combinations of options. Generally, you can write separate yml files and load them selectively using phpspec's -c option. Filters are applied in the order listed in the configuration, so technically the FastestFirstFilter would be undone by the ShuffleFilter for specs in the above. All filters are supplied a referenced array of either examples or specifications to play with.

These extensions are primarily targeted at Humbug, but are reusable/extendable for any other purpose. Knock yourself out!

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

[](#installation)

```
require: {
   "padraic/phpspec-extensions": "dev-master"
}
```

Usage Examples
==============

[](#usage-examples)

Free memory after running a specification. This clears out any non phpspec properties on the class which may improve performance somewhat:

```
formatter.name: pretty
extensions:
- Humbug\PhpSpec\FreeMemoryExtension
```

Generate timing data for any timing related filters (run prior to activating such filters):

```
formatter.name: pretty
humbug.time_collector.target: /tmp/phpspec.times.humbug.json
extensions:
- Humbug\PhpSpec\TimeCollectorExtension
- Humbug\PhpSpec\FreeMemoryExtension
```

Use the timing to run specifications fastest first:

```
formatter.name: pretty
humbug.filtered_resource_loader.filters:
- Humbug\PhpSpec\Loader\Filter\Specification\FastestFirstFilter
humbug.time_collector.target: /tmp/phpspec.times.humbug.json
extensions:
- Humbug\PhpSpec\FilteredResourceLoaderExtension
- Humbug\PhpSpec\FreeMemoryExtension
```

Worried about any odd inter-example or inter-specification dependencies? Root them out by shuffling examples and specifications. Specification position in a suite, or example position in a specification, will be randomly distributed.

```
formatter.name: pretty
humbug.filtered_resource_loader.filters:
- Humbug\PhpSpec\Loader\Filter\Specification\ShuffleFilter
- Humbug\PhpSpec\Loader\Filter\Example\ShuffleFilter
extensions:
- Humbug\PhpSpec\FilteredResourceLoaderExtension
- Humbug\PhpSpec\FreeMemoryExtension
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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://www.gravatar.com/avatar/341071ec57d8a3a85e38b0667e8b5550af888ba56573c44dc21efceed9e29e37?d=identicon)[padraicb](/maintainers/padraicb)

---

Top Contributors

[![padraic](https://avatars.githubusercontent.com/u/19780?v=4)](https://github.com/padraic "padraic (44 commits)")

---

Tags

humbugphpspec

### Embed Badge

![Health badge](/badges/padraic-phpspec-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/padraic-phpspec-extensions/health.svg)](https://phpackages.com/packages/padraic-phpspec-extensions)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[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)

PHPackages © 2026

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