PHPackages                             stephenjude/api-test-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. stephenjude/api-test-helper

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

stephenjude/api-test-helper
===========================

A collection of helper methods for testing and debugging API endpoints

3.0.0(2y ago)503.3k1MITPHPPHP ^8.0

Since Nov 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/stephenjude/api-test-helper)[ Packagist](https://packagist.org/packages/stephenjude/api-test-helper)[ Docs](https://github.com/stephenjude/api-test-helper)[ RSS](/packages/stephenjude-api-test-helper/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (3)Versions (15)Used By (0)

Laravel API Test Helpers
========================

[](#laravel-api-test-helpers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9caf71e52fdb496fb7812e33b64f32f0379d610457b21109d532422f78e6adbd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374657068656e6a7564652f6170692d746573742d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stephenjude/api-test-helper)[![Build Status](https://camo.githubusercontent.com/77ab784d8985935f31f34e586881ea270944265a4afb14865cdb565bbccf2c33/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7374657068656e6a7564652f6170692d746573742d68656c7065722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/stephenjude/api-test-helper)[![Total Downloads](https://camo.githubusercontent.com/865521f7d82b18d45226806af851f1d3c24a31e53ffbcc9ceca475c1e1bdb827/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7374657068656e6a7564652f6170692d746573742d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stephenjude/api-test-helper)

This is a collection of helper methods for testing and debugging API endpoints.

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

[](#installation)

You can install the package via composer:

```
composer require stephenjude/api-test-helper --dev
```

Usage
-----

[](#usage)

```
namespace Tests\Apis;

use App\Models\User;
use Tests\TestCase;
use Stephenjude\ApiTestHelper\WithApiHelper;

class UserApiTest extends TestCase
{
    use WithApiHelper;

    /*
    * @test
    */
    public function testGetAllUsers()
    {
        $actualUsers = User::all();

        $this->response = $this->getJson('/users');

        // Assert response is 200
        $this->response->assertOk();

        // Dump api data to the console
        $this->dumpApiData();

        // Write api data to the log file
        $this->logApiData();

        // Return a decoded api response data
        $responseData = $this->decodeApiResponse();

        // Assert API data is a collection
        $this->assertApiResponseCollection($actualUsers);
    }
}
```

Available Helper Methods
------------------------

[](#available-helper-methods)

MethodDescription`decodeApiResponse()`Returns a decoded api response data.`dumpApiData()`Dump api response data to the console.`logApiData()`Write api response data to the log file.`assertApiSuccess()`Assert api response data is successful: \[success =&gt; true\].`assertApiResponse($actualData)`Assert api response data is same actual data item.`assertApiResponseCollection($actualData)`Assert api response data is same actual collection items.### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Stephen Jude](https://github.com/stephenjude)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 96% 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 ~109 days

Recently: every ~143 days

Total

10

Last Release

1026d ago

Major Versions

1.0.5 → 2.0.02022-02-09

2.0.2 → 3.0.02023-07-27

PHP version history (3 changes)1.0PHP ^7.1

1.0.5PHP ^7.1|^8.0

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb8b712638a0d72afbc4e21574989fdfc33717a69ea3070e92104183db8068f9?d=identicon)[stephenjude](/maintainers/stephenjude)

---

Top Contributors

[![stephenjude](https://avatars.githubusercontent.com/u/31182887?v=4)](https://github.com/stephenjude "stephenjude (24 commits)")[![eyounelson](https://avatars.githubusercontent.com/u/24621192?v=4)](https://github.com/eyounelson "eyounelson (1 commits)")

---

Tags

apiapi-testinghelperslaravellaravel-frameworktestingstephenjudeapi-test-helper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stephenjude-api-test-helper/health.svg)

```
[![Health](https://phpackages.com/badges/stephenjude-api-test-helper/health.svg)](https://phpackages.com/packages/stephenjude-api-test-helper)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[illuminate/testing

The Illuminate Testing package.

3315.6M113](/packages/illuminate-testing)[christophrumpel/missing-livewire-assertions

This package adds missing livewire test assertions.

149336.0k9](/packages/christophrumpel-missing-livewire-assertions)[calebdw/larastan-livewire

A Larastan / PHPStan extension for Livewire.

43482.4k3](/packages/calebdw-larastan-livewire)[encodia/laravel-health-env-vars

Custom check for Spatie's Laravel Health - Ensure every .env variable you need has been set

20143.5k](/packages/encodia-laravel-health-env-vars)

PHPackages © 2026

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