Generic PSR-15 Functional Test Module for Codeception
Add Psr15 functional test module to your finctional.suite.yml
:
# Codeception Test Suite Configuration
class_name: FunctionalTester
modules:
enabled:
- \Lapaz\Codeception\Psr15\Module\Psr15:
requestHandler: tests/_app/handler.php
- \Helper\Functional
- Asserts
tests/_app/handler.php
example using PSR-11 DI container:
<?php
/** @var \Psr\Container\ContainerInterface $di */
$di = require __DIR__ . '/../../config/container.php';
return $di->get('rootRequestHandler');
Then you can test the middleware as your application below:
$I->amOnPage('/');
$I->see('Expected text');