php - 如何在一个项目中的不同文件夹中添加多个代码接收套件?

标签 php unit-testing testing phpunit codeception

我有以下文件夹结构,我希望多个测试套件存在于不同的目录中。

- project
    - app
        - app-A
            - tests
                - (functional tests here)

        - app-B
            - tests
                - (functional tests here)

    - domains
        - domain-A
            - tests
                - (unit tests here)

        - domain-B
            - tests
                - (unit tests here)

最佳答案

<强>1。在项目的根目录中创建 codeception.yml 文件

<强>2。通过该文件中的以下内容:

include:

  - 

paths:

  log: log

settings:

  colors: true

<强>3。在它们的子目录中生成一些测试套件:

codecept bootstrap /.../src/Domains/User --namespace user

codecept bootstrap /.../src/Application/Cms --namespace cms

<强>4。通过在 includes 下包含测试套件的路径来更新根目录的 codeception.yml

include:

  - src/Domains/User

  - src/Application/Cms

<强>5。生成一些测试

codecept generate:cept --config src/Domains/User unit testB

codecept generate:cept --config src/Applications/Cms functional testA

6.运行测试

codecept run

关于php - 如何在一个项目中的不同文件夹中添加多个代码接收套件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31184936/

相关文章:

testing - 服务器和 API 负载测试

java - Easymock 模拟输入流读取操作

sql - 为什么来自 Red Gate SQL Test 的第一个 tSQLt 样本测试在我的系统上失败了?

testing - 记录登录功能后,如何切换到 jmeter(http post 请求)中的参数选项卡

java - 我在 Selenium 中使用页面对象模型是否正确?

c++ - boost 测试库: Multiple definition error

php - 为每次提交创建一个新页面 - PHP 错误

php - 如何在 Zend Framework 2 和 Zend Filter 中以 Zip 格式压缩上传的文件

php - 如何操作/访问从自动完成 ajax 收到的 json?

带有 Laravel 的 PHP 应用服务器