【发布时间】:2023-04-04 13:05:01
【问题描述】:
在我的计算机上,我有一个 CakePHP 项目。在 cakephp 项目中,我有一个 composer.json 文件,如下所示:
{
"name": "a/b",
"description": "c",
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/phpunit-selenium": ">=1.2"
},
"license": "Proprietary",
"authors": [
{
"name": "d",
"email": "e"
}
],
"minimum-stability": "f"
}
在运行composer install 之后,我已经安装了 phpunit 和 selenium 包并在这里工作
/cakephpproject/vendor/bin/phpunit/cakephpproject/vendor/phpunit/phpunit-selenium
现在我从/cakephpproject/app/ 尝试运行以下命令
../vendor/bin/phpunit Test/Case/Controller/MyControllerTest
但我收到以下错误消息
致命错误:找不到类“App”...
如果我使用./Console/cake test app Controller/GranulesController,测试会尝试运行,但会抛出PHPUnit_Extensions_Selenium2TestCase not found 错误,因为系统上没有安装 PHPUnit Selenium。
如何让 cakephp 使用我使用 composer 安装的 phpunit 和 phpunit-selenium,而不使用全局安装的 phpunit?
【问题讨论】:
标签: php cakephp selenium phpunit