【发布时间】:2017-03-01 05:43:27
【问题描述】:
我在 docker 容器中通过 PHPUnit 测试 CakePHP2 应用程序时遇到了一些问题。
CakePHP2 testing guide 声明,与 CakePHP2 兼容的最后一个 PHPUnit 版本是 3.7.38。
我正在使用这个版本,但我仍然收到以下错误:
警告错误:包含(PHPUnit/Autoload.php):无法打开流:[/builds/application_folder/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php,第 162 行]中没有这样的文件或目录]
警告错误:include(): 在 [/builds /application_folder/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php,第 162 行]
有一个与此错误相关的issue,但已通过从 PHPUnit 4 降级到 PHPUnit 3 解决。
这是我用于 GitLab Runner 的映像的 Dockerfile
FROM php:5
RUN apt-get update -y
RUN apt-get install -y wget
RUN sh -c 'wget -c https://phar.phpunit.de/phpunit-3.7.38.phar -O phpunit.phar && chmod +x phpunit.phar && mv phpunit.phar /usr/local/bin/phpunit'
在我的 .gitlab-ci.yml 的 before_script 部分中,我打印 PHPUnit 版本以验证是否安装了正确的版本并打印 3.7.38。
我将不胜感激!
【问题讨论】:
-
我有同样的问题,但目前没有解决方案:-(
标签: cakephp docker phpunit gitlab-ci