PHPackages                             docler-labs/codeception-slim-module - 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. docler-labs/codeception-slim-module

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

docler-labs/codeception-slim-module
===================================

Codeception Module for Slim framework.

4.3.0(1mo ago)13178.0k↓12.1%51MITPHPPHP ^8.0CI passing

Since Oct 13Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/DoclerLabs/codeception-slim-module)[ Packagist](https://packagist.org/packages/docler-labs/codeception-slim-module)[ RSS](/packages/docler-labs-codeception-slim-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (14)Versions (13)Used By (1)

DoclerLabs - Codeception Slim Module
====================================

[](#doclerlabs---codeception-slim-module)

[![Build Status](https://camo.githubusercontent.com/fb000da07ec5024a8ef79792cc3d9aafc038e213f373e8764ba7c29b155e450c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f446f636c65724c6162732f636f646563657074696f6e2d736c696d2d6d6f64756c652f43493f6c6162656c3d6275696c64267374796c653d666c61742d737175617265)](https://github.com/DoclerLabs/codeception-slim-module/actions?query=workflow%3ACI)[![PHPStan Level](https://camo.githubusercontent.com/fff00cebb924e124a7335e6bd8ca8f8cf38869463c1654eff45d0939f1f21c57/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg)

This module allows you to run functional tests inside [Slim 4 Microframework](http://www.slimframework.com/docs/v4/) without HTTP calls, so tests will be much faster and debug could be easier.

Inspiration comes from [herloct/codeception-slim-module](https://github.com/herloct/codeception-slim-module) library.

Install
-------

[](#install)

### Minimal requirements

[](#minimal-requirements)

- php: `^8.0`
- slim/slim: `^4.7`
- codeception/codeception: `^5.0`

If you don't know Codeception, please check [Quickstart Guide](https://codeception.com/quickstart) first.

If you already have [Codeception](https://github.com/Codeception/Codeception) installed in your Slim application, you can add codeception-slim-module with a single composer command.

```
composer require --dev docler-labs/codeception-slim-module
```

For PHP 7 support, please use `docler-labs/codeception-slim-module:^2.0` version

```
composer require --dev docler-labs/codeception-slim-module "^2.0"
```

If you use Slim v3, please use the previous version from library:

```
composer require --dev docler-labs/codeception-slim-module "^1.0"
```

### Configuration

[](#configuration)

**Example (`test/suite/functional.suite.yml`)**

```
modules:
  enabled:
    - REST:
        depends: DoclerLabs\CodeceptionSlimModule\Module\Slim

  config:
    DoclerLabs\CodeceptionSlimModule\Module\Slim:
      application: path/to/application.php
```

The `application` property is a relative path to file which returns your `Slim\App` instance.

You can also configure default headers that will be sent with every request using the `headers` option:

```
modules:
  enabled:
    - REST:
        depends: DoclerLabs\CodeceptionSlimModule\Module\Slim

  config:
    DoclerLabs\CodeceptionSlimModule\Module\Slim:
      application: path/to/application.php
      headers:
        Content-Type: application/json
        Accept: application/json
```

Here is the minimum `application.php` content:

```
require __DIR__ . '/vendor/autoload.php';

use Slim\Factory\AppFactory;

$app = AppFactory::create();

// Add routes and middlewares here.

return $app;
```

Testing your API endpoints
--------------------------

[](#testing-your-api-endpoints)

```
class UserCest
{
    public function getUserReturnsWithEmail(FunctionalTester $I): void
    {
        $I->haveHttpHeader('Content-Type', 'application/json');

        $I->sendGET('/users/John');

        $I->seeResponseCodeIs(200);
        $I->seeResponseContainsJson(
            [
                'email' => 'john.doe@example.com',
            ]
        );
    }
}
```

### With default headers

[](#with-default-headers)

When you configure default `headers` in your suite configuration, you no longer need to set them manually in each test:

```
class UserCest
{
    // Content-Type and Accept headers are already set via module config
    public function getUserReturnsWithEmail(FunctionalTester $I): void
    {
        $I->sendGET('/users/John');

        $I->seeResponseCodeIs(200);
        $I->seeResponseContainsJson(
            [
                'email' => 'john.doe@example.com',
            ]
        );
    }

    public function createUserReturnsCreated(FunctionalTester $I): void
    {
        $I->sendPOST('/users', ['name' => 'Jane', 'email' => 'jane.doe@example.com']);

        $I->seeResponseCodeIs(201);
    }
}
```

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance88

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~221 days

Total

11

Last Release

59d ago

Major Versions

1.0.0 → 2.0.02020-11-05

1.0.1 → 3.0.02022-03-08

3.0.0 → 4.0.02022-10-26

1.1.0 → 4.2.02024-03-15

1.2.0 → 4.3.02026-03-20

PHP version history (3 changes)1.0.0PHP ^7.2

3.0.0PHP ^8.0

1.1.0PHP ^7.2 || ^8.0

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/87966ff11d1a8df3887095bb776fd07aa7345250c2fd41dd100414171cc0ffaf?d=identicon)[meetmatt](/maintainers/meetmatt)

![](https://www.gravatar.com/avatar/5f026b1b88a0ea363236c0f0f1b4afe0b4f0c46a7bd191f632c47ef08a68a000?d=identicon)[tommey](/maintainers/tommey)

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

---

Top Contributors

[![szhajdu](https://avatars.githubusercontent.com/u/4129631?v=4)](https://github.com/szhajdu "szhajdu (9 commits)")[![tommey](https://avatars.githubusercontent.com/u/903833?v=4)](https://github.com/tommey "tommey (8 commits)")[![sabee-bb](https://avatars.githubusercontent.com/u/157013358?v=4)](https://github.com/sabee-bb "sabee-bb (5 commits)")[![xklid101](https://avatars.githubusercontent.com/u/7311741?v=4)](https://github.com/xklid101 "xklid101 (2 commits)")[![iliayatsenko](https://avatars.githubusercontent.com/u/18085174?v=4)](https://github.com/iliayatsenko "iliayatsenko (1 commits)")[![tamastoth-byborg](https://avatars.githubusercontent.com/u/182635118?v=4)](https://github.com/tamastoth-byborg "tamastoth-byborg (1 commits)")

---

Tags

codeceptioncodeception-moduleslimslim-frameworktestingcodeceptionslimmodule

### Embed Badge

![Health badge](/badges/docler-labs-codeception-slim-module/health.svg)

```
[![Health](https://phpackages.com/badges/docler-labs-codeception-slim-module/health.svg)](https://phpackages.com/packages/docler-labs-codeception-slim-module)
```

###  Alternatives

[codeception/module-symfony

Codeception module for Symfony framework

949.4M95](/packages/codeception-module-symfony)[codeception/module-webdriver

WebDriver module for Codeception

3831.4M245](/packages/codeception-module-webdriver)[herloct/codeception-slim-module

Codeception Module for Slim 3 Microframework.

26130.9k5](/packages/herloct-codeception-slim-module)[contributte/codeception

Integration of Nette framework to Codeception.

27886.9k1](/packages/contributte-codeception)[jayhealey/webception

Web Interface for running Codeception tests.

19110.7k](/packages/jayhealey-webception)[mcustiel/codeception-http-mock

Extension for HTTP Mock.

1424.3k1](/packages/mcustiel-codeception-http-mock)

PHPackages © 2026

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