PHPackages                             soft-passio/api-test-cases - 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. soft-passio/api-test-cases

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

soft-passio/api-test-cases
==========================

Test cases for boost up writing PHPUnit tests for API with Symfony 3 framework

2.1.6(5y ago)01.1k↓100%MITPHPPHP ^7.2

Since Jul 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/SoftPassio/ApiTestCasesBundle)[ Packagist](https://packagist.org/packages/soft-passio/api-test-cases)[ RSS](/packages/soft-passio-api-test-cases/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)Dependencies (9)Versions (11)Used By (0)

ApiTestCasesBundle
==================

[](#apitestcasesbundle)

Test cases for boost up writing PHPUnit functional tests for API with Symfony framework. Bundle is helping you debuging failed tests and bosting TDD process.

Examples failed response
------------------------

[](#examples-failed-response)

```
Failure! when making the following request:
POST: http://foo.app/app_test.php/api/security/token

HTTP/1.1 404 Not Found
Date: Sat, 08 Jul 2017 12:28:19 GMT
Server: Apache
X-Powered-By: PHP/7.0.15
Cache-Control: no-cache, private
Content-Length: 84
Content-Type: application/problem+json
{
    "detail": "Client is blocked",
    "status": 404,
    "type": "about:blank",
    "title": "Not Found"
}

"Client is blocked" does not match "Client is blockedx".
@@ -1,5 +1,5 @@
 {
-  "detail": "Client is blockedx",
+  "detail": "Client is blocked",
   "status": 404,
   "type": "about:blank",
   "title": "Not Found"

```

Usage
-----

[](#usage)

All you need to do is extend JsonApiTestCase in your functional controller class.

```
use SoftPassio\ApiTestCasesBundle\Api\Cases\JsonApiTestCase;
use Symfony\Component\HttpFoundation\Response;

class ProfileControllerTest extends JsonApiTestCase
{
    ...
}

```

Testing API methods
-------------------

[](#testing-api-methods)

### Test code:

[](#test-code)

```
public function testMeActionSuccess()
{
    $this->authenticateFixtureUser('profile/user.yml');
    $response = $this->client->get('/api/profile/me');

    $this->assertResponse($response, 'profile/me/success', Response::HTTP_OK);
}

```

### Alice schema file:

[](#alice-schema-file)

```
AppBundle\Entity\User:
user1:
    username: test
    email: test@test.foo
    password: test

```

### JWT authentication method with lexik/LexikJWTAuthenticationBundle:

[](#jwt-authentication-method-with-lexiklexikjwtauthenticationbundle)

```
protected function authenticateFixtureUser(
    string $userFixturePath,
    $expired = JwtTokenFactory::EXPIRATION_TIME
) {
    $this->loadFixturesFromFile($userFixturePath);

    $tokenData = [
        'username' => 'test',
        'exp'      => time() + $expired,
    ];

    $token = $this->getService('lexik_jwt_authentication.encoder')->encode($tokenData);

    self::$staticClient->setDefaultOption('headers/Authorization', 'Bearer '.$token);

    return $tokenData;
}

```

### config file - config\_test.ynl

[](#config-file---config_testynl)

```
security:
encoders:
    AppBundle\Entity\User: plaintext

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% 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 ~87 days

Recently: every ~0 days

Total

9

Last Release

2161d ago

Major Versions

1.0 → 2.02019-07-18

PHP version history (2 changes)1.0PHP ^7.0

2.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fef8e6f06a33ac6e44381dae5f8c9554545989d3a2c5f40edf636251707250e?d=identicon)[naros1988](/maintainers/naros1988)

---

Top Contributors

[![michaljedraszczyk](https://avatars.githubusercontent.com/u/884463?v=4)](https://github.com/michaljedraszczyk "michaljedraszczyk (20 commits)")[![naros1988](https://avatars.githubusercontent.com/u/7100387?v=4)](https://github.com/naros1988 "naros1988 (5 commits)")[![hbernaciak](https://avatars.githubusercontent.com/u/16296702?v=4)](https://github.com/hbernaciak "hbernaciak (2 commits)")[![mkurc1](https://avatars.githubusercontent.com/u/2181797?v=4)](https://github.com/mkurc1 "mkurc1 (1 commits)")

---

Tags

phpunitTest Casesapi cases

### Embed Badge

![Health badge](/badges/soft-passio-api-test-cases/health.svg)

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

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[lchrusciel/api-test-case

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

4115.5M63](/packages/lchrusciel-api-test-case)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[juampi92/test-seo

Easy way to test your SEO

26341.0k](/packages/juampi92-test-seo)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

1783.0k34](/packages/robiningelbrecht-phpunit-coverage-tools)

PHPackages © 2026

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