如何为 octobercms/library 执行单元测试
How to execute unit tests for octobercms/library
执行 octobercms/library 单元测试的正确方法是什么?
我可以在以下条件下成功执行单元测试。
- 使用供应商目录中我的 OctoberCMS 项目中安装的副本。
- 将october/rain/tests/phpunit.xml中的
bootstrap
路径修改为bootstrap="../../../../vendor/autoload.php"
- 从 october/rain/tests 执行
../../../../vendor/bin/phpunit
。
但是,我觉得有更好的方法。我想知道其他提交者是如何执行测试的。
首先感谢您对十月 CMS 的贡献,
我会说你不需要修改一行。
首先让我们具体一点,我们只需要测试 octobercms/library
因为我们不需要让事情变得复杂
let's assume you have working local October CMS based website on your machine.
现在转到 vendor\october\rain
文件夹,因为 october lib
在那里。 (内部终端)
现在composer install
那里
if you find any dependency issue in installation.(Then ONLY follow this), I found some problem here some dependency issue so, i need to remove this 2 dependencies from composer.json
if you find same issue then : go to "require-dev" section -> remove
1."illuminate/routing": "5.5.*"
2."swiftmailer/swiftmailer": "~5.1"
3. now try to install composer install
again.
完成后。
刚刚得到vendor\october\rain\tests
目录(终端内)
执行命令for windows .\..\vendor\bin\phpunit.bat
and for linux/mac ./../vendor/bin/phpunit
它会自动检测所有东西并为您执行测试。
如果您遇到任何问题,请添加评论。
https://github.com/octobercms/library/wiki/How-To-Use-Unit-Tests-%3F
执行 octobercms/library 单元测试的正确方法是什么?
我可以在以下条件下成功执行单元测试。
- 使用供应商目录中我的 OctoberCMS 项目中安装的副本。
- 将october/rain/tests/phpunit.xml中的
bootstrap
路径修改为bootstrap="../../../../vendor/autoload.php"
- 从 october/rain/tests 执行
../../../../vendor/bin/phpunit
。
但是,我觉得有更好的方法。我想知道其他提交者是如何执行测试的。
首先感谢您对十月 CMS 的贡献,
我会说你不需要修改一行。
首先让我们具体一点,我们只需要测试 octobercms/library
因为我们不需要让事情变得复杂
let's assume you have working local October CMS based website on your machine.
现在转到
vendor\october\rain
文件夹,因为october lib
在那里。 (内部终端)现在
composer install
那里
if you find any dependency issue in installation.(Then ONLY follow this), I found some problem here some dependency issue so, i need to remove this 2 dependencies from
composer.json
if you find same issue then : go to "require-dev" section -> remove
1."illuminate/routing": "5.5.*"
2."swiftmailer/swiftmailer": "~5.1"
3. now try to install
composer install
again.
完成后。
刚刚得到
vendor\october\rain\tests
目录(终端内)执行命令for windows
.\..\vendor\bin\phpunit.bat
and for linux/mac./../vendor/bin/phpunit
它会自动检测所有东西并为您执行测试。
如果您遇到任何问题,请添加评论。
https://github.com/octobercms/library/wiki/How-To-Use-Unit-Tests-%3F