lapaz/codeception-psr15

Codeception 通用 PSR-15 功能测试模块

0.3.1 2018-09-05 04:24 UTC

This package is auto-updated.

Last update: 2024-09-05 20:33:06 UTC


README

Build Status

将 Psr15 功能测试模块添加到您的 functional.suite.yml

# Codeception Test Suite Configuration

class_name: FunctionalTester
modules:
    enabled:
        - \Lapaz\Codeception\Psr15\Module\Psr15:
            requestHandler: tests/_app/handler.php
        - \Helper\Functional
        - Asserts

使用 PSR-11 DI 容器的 tests/_app/handler.php 示例

<?php
/** @var \Psr\Container\ContainerInterface $di */
$di = require __DIR__ . '/../../config/container.php';

return $di->get('rootRequestHandler');

然后您可以像以下应用程序一样测试中间件

$I->amOnPage('/');
$I->see('Expected text');