首页 > 解决方案 > 密码错误 | 未找到“Yii”类

问题描述

您好,我创建了一个新项目来学习代码接收。

但是当我运行“codecept run”时,我得到以下错误:

打开联系页面 (ContactFormCest::openContactPage) [Symfony\Component\Debug\Exception\FatalThrowableError] 找不到类“Yii”

我的引导文件:

?php
define(‘YII_ENV’, ‘test’);
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);
require(DIR . “/…/vendor/autoload.php”);
require(DIR . “/…/vendor/yiisoft/yii2/Yii.php”);
$config = require(__DIR__ . '/../config/console.php');
$application = new yiiconsoleApplication( $config );

我的codeception.yml:

actor: Tester
bootstrap: _bootstrap.php
 paths:
  tests: tests
  log: tests/_output
  data: tests/_data
  helpers: tests/_support
settings:
 memory_limit: 1024M
 colors: true
modules:
 config:
     Yii2:
         configFile: 'config/test.php'

标签: phpyii2codeception

解决方案


推荐阅读