lapaz / codeception-psr15
Generic PSR-15 Functional Test Module for Codeception
0.3.1
2018-09-05 04:24 UTC
Requires
- php: ^7.1
- codeception/codeception: ^2.2||^2.1.7
- http-interop/http-factory-diactoros: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- aura/di: ^3.4
- phpunit/phpunit: ^7.3.3
- zendframework/zend-diactoros: ^1.8
- zendframework/zend-httphandlerrunner: ^1.0
- zendframework/zend-stratigility: ^3.0
Suggests
- http-interop/http-factory-slim: Slim version of PSR-17 implementations instead of Diactoros
README
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');