herloct/codeception-slim-module

Codeception Module for Slim 3 Microframework.

Maintainers

👁 herloct

Package info

github.com/herloct/codeception-slim-module

pkg:composer/herloct/codeception-slim-module

Statistics

Installs: 131 531

Dependents: 5

Suggesters: 0

Stars: 26

Open Issues: 1

1.1.0 2017-03-04 20:30 UTC

Requires

  • php: ^5.6 || ^7.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 8767207016d77a147e6ad9b2f75eb7f3fdab17ba

  • Herloct <herloct.woop@gmail.com>

modulecodeceptionslim

This package is not auto-updated.

Last update: 2026-06-21 05:36:52 UTC


README

👁 Master Build Status
👁 Packagist Stable Version
👁 Packagist License
👁 Libraries.io for GitHub

This module allows you to run tests inside Slim 3 Microframework.
Based on ZendExpressive Module.

Install

Via commandline:

composer require --dev herloct/codeception-slim-module

Via composer.json:

{
 "require-dev": {
 "herloct/codeception-slim-module": "^1.1"
 }
}

Config

Put this on your codeception.yml

modules:
 config:
 \Herloct\Codeception\Module\Slim:
 container: path/to/container.php
 REST:
 depends: \Herloct\Codeception\Module\Slim

Or on your tests/functional.suite.yml

modules:
 enabled:
 - \Helper\Functional
 - \Herloct\Codeception\Module\Slim:
 container: path/to/container.php
 - REST:
 depends: \Herloct\Codeception\Module\Slim

The container properties is a relative path to file which returns your App's Container.
Here is the minimum container.php contents.

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

use Psr\Container\ContainerInterface;
use Slim\App;
use Slim\Container;

$container = new Container([
 App::class => function (ContainerInterface $c) {
 $app = new App($c);

 // routes and middlewares here

 return $app;
 }
]);

return $container;

You could use this Sample Project as a reference.

API

  • app - instance of \Slim\App
  • container - instance of \Psr\Container\ContainerInterface
  • client - BrowserKit client

Todos

  • Add more acceptance/functional tests other than REST.