php - Yii2模块未配置! - 选项 : configFile are required error - codeception

标签 php yii2 codeception

Yii2模块未配置! - 选项:configFile 是必需的错误, yii2 代码接收错误 如何修复错误?我有

suites:
    unit:
        #        path: .
        path: common
        actor: UnitTester
        modules:
            enabled:
                # add more modules here
                - Asserts
                - Yii2
settings:
    shuffle: true
    lint: true
    bootstrap: tests/_bootstrap.php
paths:
    tests: .
    output: common/_output
    support: common/_support
    data: common
modules:
    enabled:
        # add more modules here
        #- Asserts
        - Yii2

最佳答案

我自己整理了一下,没有找到答案。 通用模块项设置必须具有配置形式 - 子项必须命名为“config”而不是“enabled”,以便能够在其他地方使用,例如套件 - 单元部分/文件,并引用配置文件由基本 Yii2 模板提供或生成

modules:
  config:
    Yii2:
      configFile: 'config/test.php'

在完整上下文中可见

suites:
    unit:
#        path: .
        path: common
        actor: UnitTester
        modules:
            enabled:
                # add more modules here
                - Asserts
                - Yii2
settings:
    shuffle: true
    lint: true
    bootstrap: tests/_bootstrap.php
paths:
    tests: .
    output: common/_output
    support: common/_support
    data: common
modules:
  config:
    Yii2:
      configFile: 'config/test.php'

enter image description here

关于php - Yii2模块未配置! - 选项 : configFile are required error - codeception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58234712/

相关文章:

php - 在每个文件中包含 php 头文件

php - Yii2 无法从 MySQL 获取日期

codeception - 无法找到并加载模块 WebHelper

php - MySQL : how to create a user and how to access the mysql localhost server using php

javascript - 表的每一行上的提交按钮,将该行的数据插入数据库

php - 从一个网站自动登录到另一个网站

php - Yii2,登录后重定向。避免 Controller \ Action \行为

php - 如何在 Yii2 的 GridView::widget 的搜索框中使用带过滤功能的简单下拉列表?

php - Yii2:如何在使用 Codeception 进行测试时将日志写入文件?

php - 如何在 Codeception 助手中访问参与者(例如 AcceptanceTester)