Codeception Module for Slim 3 Microframework.
PHP Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dockerfiles/codecept
src
tests
.gitignore
.gitmodules
.travis.yml
LICENSE
README.md
codeception.yml
composer.json
docker-compose.yml

README.md

Codeception Slim Module

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.0"
  }
}

Config

  • container: relative path to file which returns Container.
\Herloct\Codeception\Module\Slim:
  container: path/to/container.php

Minimum container.php contents.

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

use Interop\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;

API

  • application - instance of \Slim\App
  • container - instance of \Interop\Container\ContainerInterface
  • client - BrowserKit client

Todos

  • Add more acceptance/functional tests other than REST.