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)161.9k2[4 PRs](https://github.com/narrowspark/testing-helper/pulls)3MITPHPPHP ^7.2

Since Jan 8Pushed 3y 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 1mo 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

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

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

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

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[php-mock/php-mock-phpunit

Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.

1718.2M399](/packages/php-mock-php-mock-phpunit)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33412.5M350](/packages/brain-monkey)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[polishsymfonycommunity/symfony-mocker-container

Provides base Symfony dependency injection container enabling service mocking.

1468.0M237](/packages/polishsymfonycommunity-symfony-mocker-container)[colinodell/psr-testlogger

PSR-3 compliant test logger based on psr/log v1's, but compatible with v2 and v3 too!

1712.1M47](/packages/colinodell-psr-testlogger)

PHPackages © 2026

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