lapaz / codeception-psr15
Generic PSR-15 Functional Test Module for Codeception
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 1
pkg:composer/lapaz/codeception-psr15
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');