Download the PHP package jasny/codeception-module without Composer
On this page you can find all versions of the php package jasny/codeception-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jasny/codeception-module
More information about jasny/codeception-module
Files in jasny/codeception-module
Package codeception-module
Short Description Codeception Module for Jasny MVC
License MIT
Informations about the package codeception-module
Codeception Jasny MVC Module
This module allows you to run tests using Jasny MVC.
Install
Via commandline:
Via composer.json
:
Config
- container: Path to file that returns a
Interop\Container\ContainerInterface
.
Container
The container an object that takes care or depency injection. It must be an object the implements Interop\Container\ContainerInterface
.
If you're project doesn't use an dependency injection container, you can use Picotainer,
which is automatically installed with this codeception module.
The container must contain an item for Jasny\RouterInterface
.
Example of container.php
using Picotainer.
The cointain may have a Psr\Http\Message\ServerRequestInterface
and Psr\Http\Message\ResponseInterface
item.
Legacy code
The Jasny PSR-7 http message implementation is capable of dealing with legacy code by binding to the global environment.
This allows testing of code that accesses superglobals like $_GET
and $_POST
and outputs using echo
and
headers()
.
Use withGlobalEnvironment(true)
for both request and response object. The Codeception module will make sure
output buffering starts and everything is restored after each test.
Error handler
The container may also contain a Jasny Error Handler. If a fatal error is caught by the error handler, the output is typically a nice message intended for the end user. It doesn't contain any information about the error itself.
If the container has a Jasny\ErrorHandlerInterface
object, it will output the error as debug information on a failed
test. To see the error use the --debug
flag when running composer run
.
API
- container - The container
- client - BrowserKit client
All versions of codeception-module with dependencies
codeception/codeception Version ^4.0
codeception/lib-innerbrowser Version ^1.2
jasny/http-message Version ^1.3
jasny/router Version ^1.1
psr/container Version ^1.0
symfony/http-client Version ^5.0