PHPackages                             adbros/controller-tester - 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. adbros/controller-tester

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

adbros/controller-tester
========================

Simple Apitte Controllers testing.

v0.3.1(2y ago)244.4k↓35%2MITPHPPHP &gt;=7.4

Since Sep 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/adbrosaci/controller-tester)[ Packagist](https://packagist.org/packages/adbros/controller-tester)[ RSS](/packages/adbros-controller-tester/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (20)Used By (0)

ControllerTester
================

[](#controllertester)

Simple Apitte Controllers testing.

---

[![main workflow](https://github.com/adbrosaci/controller-tester/actions/workflows/main.yml/badge.svg)](https://github.com/adbrosaci/controller-tester/actions/workflows/main.yml)[![Code coverage](https://camo.githubusercontent.com/917e475c88d74aaf0a9b549fe265c35f2ae1d03167ec8ec7381d74a9e3da9747/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f616462726f736163692f636f6e74726f6c6c65722d7465737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/adbrosaci/controller-tester)[![Licence](https://camo.githubusercontent.com/6f8770e9b711fd10ed624f39a555bfc15723484f4e41610fbad2c865baf5116f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616462726f732f636f6e74726f6c6c65722d7465737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adbros/controller-tester)[![Downloads this Month](https://camo.githubusercontent.com/efff358f197a4f4e39741b166be4268eaa472f6fcad26227fbd22d13e78f9f01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f616462726f732f636f6e74726f6c6c65722d7465737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adbros/controller-tester)[![Downloads total](https://camo.githubusercontent.com/777f952bc047030bb1ec752be86e6c34b3d8a824e12adedc7abfba69a413d724/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616462726f732f636f6e74726f6c6c65722d7465737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adbros/controller-tester)[![Latest stable](https://camo.githubusercontent.com/3a670d8a240578e4cce9cbc539d10d0522da7c24504ad721d4c707c269a73eaf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616462726f732f636f6e74726f6c6c65722d7465737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adbros/controller-tester)

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

[](#installation)

```
composer require adbros/controller-tester --dev
```

Configuration
-------------

[](#configuration)

Just register ControllerTester in config.neon.

```
services:
    - Adbros\Tester\ControllerTester\ControllerTester
```

Usage
-----

[](#usage)

```
public function testPostHelloWorld(): void
{
    $controllerTester = $this->container->getByType(ControllerTester::class);

    $request = $controllerTester->createRequest('/api/v1/dummy/hello-world')
        ->withMethod('POST')
        ->withJsonBody([
            'foo' => 'bar',
        ]);
    $result = $controllerTester->execute($request);

    $result->assertJson([
        'status' => 'ok',
        'payload' => [
            'foo' => 'bar',
        ],
    ]);
    $result->assertStatusCode(200);
}
```

TestControllerRequest API
-------------------------

[](#testcontrollerrequest-api)

TestControllerRequest is **immutable** object.

### `withParameters(array $parameters)`

[](#withparametersarray-parameters)

Add QUERY parameters.

### `withMethod(string $method)`

[](#withmethodstring-method)

Set HTTP method. Default method is `GET`.

### `withRawBody(string $body)`

[](#withrawbodystring-body)

Set request RAW body.

### `withJsonBody(array $body)`

[](#withjsonbodyarray-body)

Set request JSON body.

### `withParsedBody(array $body)`

[](#withparsedbodyarray-body)

Set POST request with parsed body like x-www-form-urlencoded.

### `withFile(string $name, string $filePath)`

[](#withfilestring-name-string-filepath)

Add file - Psr7UploadedFile

### `withHeaders(array $headers)`

[](#withheadersarray-headers)

Add HTTP headers.

### `withProtocolVersion(string $protocolVersion)`

[](#withprotocolversionstring-protocolversion)

Set HTTP protocol version. Default protocol version is `1.1`.

### `withServerParams(array $serverParams)`

[](#withserverparamsarray-serverparams)

Add SERVER parameters.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.2% 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 ~67 days

Recently: every ~134 days

Total

19

Last Release

840d ago

PHP version history (3 changes)v0.1PHP &gt;=7.2

v0.2.1PHP &gt;=7.3

v0.3PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13311472?v=4)[Martin Brettschneider](/maintainers/martenb)[@martenb](https://github.com/martenb)

---

Top Contributors

[![martenb](https://avatars.githubusercontent.com/u/13311472?v=4)](https://github.com/martenb "martenb (34 commits)")[![Ivorius](https://avatars.githubusercontent.com/u/552101?v=4)](https://github.com/Ivorius "Ivorius (4 commits)")[![phebix](https://avatars.githubusercontent.com/u/7292342?v=4)](https://github.com/phebix "phebix (1 commits)")

---

Tags

nettetesterapitte

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/adbros-controller-tester/health.svg)

```
[![Health](https://phpackages.com/badges/adbros-controller-tester/health.svg)](https://phpackages.com/packages/adbros-controller-tester)
```

###  Alternatives

[nette/tester

Nette Tester: enjoyable unit testing in PHP with code coverage reporter. 🍏🍏🍎🍏

4917.3M1.5k](/packages/nette-tester)[contributte/apitte

An opinionated and enjoyable API framework based on Nette Framework. Supporting content negotiation, debugging, middlewares, attributes and loving openapi/swagger.

641.3M3](/packages/contributte-apitte)[contributte/codeception

Integration of Nette framework to Codeception.

27886.9k1](/packages/contributte-codeception)

PHPackages © 2026

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