PHPackages                             narrowspark/testing-helper - 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. narrowspark/testing-helper

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

narrowspark/testing-helper
==========================

Provides test helpers.

8.0.2(6y ago)162.4k2[1 issues](https://github.com/narrowspark/testing-helper/issues)[4 PRs](https://github.com/narrowspark/testing-helper/pulls)3MITPHPPHP ^7.2

Since Jan 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/narrowspark/testing-helper)[ Packagist](https://packagist.org/packages/narrowspark/testing-helper)[ Docs](https://github.com/narrowspark/testing-helper)[ RSS](/packages/narrowspark-testing-helper/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (10)Versions (23)Used By (3)

Narrowspark Testing Helper
==========================

[](#narrowspark-testing-helper)

 [![](https://camo.githubusercontent.com/9523024f9f7e0078e59672658d5fb6c72acf0b888c974edb3f8f68892c64c1f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6172726f77737061726b2f74657374696e672d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://github.com/narrowspark/testing-helper/releases) [![](https://camo.githubusercontent.com/e243dd412fc99473435d040a0afcf80ae870af909aa4a9bfc418e03224cf8115/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e322e302d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/) [![](https://camo.githubusercontent.com/b6a8d2695f705e251adace322aed798914d4062f4894e158ce494e9426b9f00a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e6172726f77737061726b2f74657374696e672d68656c7065722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/narrowspark/testing-helper) [![](https://camo.githubusercontent.com/fee5a51df89715d64c9ac5bc80426b551728157891c99decd39feb56fc980db4/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6e6172726f77737061726b2f74657374696e672d68656c7065722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/narrowspark/testing-helper) [![](https://camo.githubusercontent.com/f8d9da96490aa57d7276be058339575d9a02990b35c7533dec59a33405fa79dc/68747470733a2f2f696d672e736869656c64732e696f2f6769747465722f726f6f6d2f6e776a732f6e772e6a732e7376673f7374796c653d666c61742d737175617265)](https://gitter.im/narrowspark/framework) [![](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://opensource.org/licenses/MIT)

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

[](#installation)

Via Composer

```
$ composer require narrowspark/testing-helper
```

Usage
-----

[](#usage)

```
use Narrowspark\TestingHelper\Traits\AssertArrayTrait;

class ModelTest extends \PHPUnit_Framework_TestCase
{
    use AssertArrayTrait;

    // Now you can do something like this.
    public function testIfArrayContainIrix()
    {
        $haystack = ['Mac', 'NT', 'Irix', 'Linux'];

        self::assertInArray('Irix', $haystack);
    }

    // or
    public function testAssertArraySubsetThrowsExceptionForInvalidSubset(): void
    {
        $this->expectException(ExpectationFailedException::class);

        $this->assertArraySubset([6, 7], [1, 2, 3, 4, 5, 6]);
    }
}
```

Testing
-------

[](#testing)

You need to run:

```
$ phpunit
```

Contributing
------------

[](#contributing)

If you would like to help take a look at the [list of issues](http://github.com/narrowspark/testing-helper/issues) and check our [Contributing](CONTRIBUTING.md) guild.

> **Note:** Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits
-------

[](#credits)

- [Daniel Bannert](https://github.com/prisis)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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

Every ~80 days

Recently: every ~157 days

Total

18

Last Release

2454d ago

Major Versions

v3.0.0 → v4.0.02017-07-17

v4.0.1 → v5.0.02017-10-19

v5.0.0 → v6.0.02018-01-24

v6.0.0 → v7.0.02018-07-31

v7.0.0 → 8.0.02019-08-01

PHP version history (4 changes)v1.0.0PHP &gt;=5.6.4

v2.0.0PHP ^7.0

v4.0.0PHP ^7.1

v7.0.0PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6816093?v=4)[DANMEDOC33](/maintainers/dani33)[@dani33](https://github.com/dani33)

---

Top Contributors

[![prisis](https://avatars.githubusercontent.com/u/2716058?v=4)](https://github.com/prisis "prisis (70 commits)")

---

Tags

fakermockeryphp72phpunitpsr-11psr-15phpunittestfakermockerymockgettersettertiming

### Embed Badge

![Health badge](/badges/narrowspark-testing-helper/health.svg)

```
[![Health](https://phpackages.com/badges/narrowspark-testing-helper/health.svg)](https://phpackages.com/packages/narrowspark-testing-helper)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.1k](/packages/typo3-cms-core)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M126](/packages/mezzio-mezzio)

PHPackages © 2026

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