PHPackages                             kglogowski/rest-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. kglogowski/rest-test-helper

ActiveSymfony-bundle[Testing &amp; Quality](/categories/testing)

kglogowski/rest-test-helper
===========================

Library to help with testing rest api

1.0.3(7y ago)11.1kMITPHPPHP &gt;=7.1.0

Since Dec 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/kglogowski/rest-test-helper)[ Packagist](https://packagist.org/packages/kglogowski/rest-test-helper)[ RSS](/packages/kglogowski-rest-test-helper/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (12)Versions (6)Used By (0)

rest-test-helper
================

[](#rest-test-helper)

1. Run command: `composer require kglogowski/rest-test-helper`
2. Basic usage:

    ```
    class TestUserController extends AbstractController
    {
       const ROUTE = 'user.get';

       /**
        * testGetSuccess
       */
       public function testGetSuccess()
       {
           $crawler = $this->createCrawler();

           $crawler
               ->click(
                   Request::METHOD_GET, //Request type
                   $this->getRequestHeaders(), //Headers, overwrite method
                   $this->getUrl(self::ROUTE, ['id' => 1]) //Generate url
               )
               ->checkStatus(Response::HTTP_OK) //Check status response
               ->child('id') //Go to child
                   ->assertActive(ResponseCrawlerInterface::ASSERT_EQUALS, [
                       1
                   ])
               ->end()
               ->child('email')
                   ->assertActive(ResponseCrawlerInterface::ASSERT_NOT_NULL)
               ->end()
           ;
       }
    }
    ```

    For this example, json response should look like:

    ```
    {
       "id": 1,
       "login": "username"
    }
    ```
3. Test with json in request:

    Request json:

    ```
    {
     "first_name": "FirstName",
     "last_name": "Surname",
     "email": "email@email.com",
     "role": "ROLE_ADMIN",
     "status": "ACTIVE"
    }
    ```

    path to mock json: /mock/test.json

    Code:

    ```
    class TestUserController extends AbstractController
    {
       const ROUTE = 'user.post';

       /**
        * testGetSuccess
       */
       public function testPostSuccess()
       {
           $crawler = $this->createCrawler();

           $crawler
               ->click(
                   Request::METHOD_POST,
                   $this->getRequestHeaders(),
                   $this->getUrl(self::ROUTE),
                           $this->getJsonMockFileContent($file)

                   ;

           /**
            * {@inheritdoc}
            */
           public function getMockDir(): string
           {
               return __DIR__ . '/mock/';
           }
       }
    }
    ```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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 ~52 days

Total

5

Last Release

2851d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38476b18227debf0dd28bdadd8299f63a89f2369642bc0c2575b5247240cac8c?d=identicon)[kglogowski](/maintainers/kglogowski)

---

Top Contributors

[![kglogowski](https://avatars.githubusercontent.com/u/4816993?v=4)](https://github.com/kglogowski "kglogowski (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kglogowski-rest-test-helper/health.svg)

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

###  Alternatives

[liip/functional-test-bundle

This bundles provides additional functional test-cases for Symfony applications

65010.8M86](/packages/liip-functional-test-bundle)[timacdonald/log-fake

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

4235.9M54](/packages/timacdonald-log-fake)[lchrusciel/api-test-case

Perfect PHPUnit TestCase for JSON/XML API TDD with Symfony.

4115.5M63](/packages/lchrusciel-api-test-case)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2021.0M276](/packages/drupal-core-dev)[liip/test-fixtures-bundle

This bundles enables efficient loading of Doctrine fixtures in functional test-cases for Symfony applications

1798.3M42](/packages/liip-test-fixtures-bundle)[pierstoval/smoke-testing

Smoke testing automator for Symfony applications

4032.6k](/packages/pierstoval-smoke-testing)

PHPackages © 2026

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