如何为 octobercms/library 执行单元测试

How to execute unit tests for octobercms/library

执行 octobercms/library 单元测试的正确方法是什么?

我可以在以下条件下成功执行单元测试。

但是,我觉得有更好的方法。我想知道其他提交者是如何执行测试的。

首先感谢您对十月 CMS 的贡献,

我会说你不需要修改一行。

首先让我们具体一点,我们只需要测试 octobercms/library 因为我们不需要让事情变得复杂

let's assume you have working local October CMS based website on your machine.

  1. 现在转到 vendor\october\rain 文件夹,因为 october lib 在那里。 (内部终端)

  2. 现在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.

  1. 完成后。

  2. 刚刚得到vendor\october\rain\tests目录(终端内)

  3. 执行命令for windows .\..\vendor\bin\phpunit.bat and for linux/mac ./../vendor/bin/phpunit

  4. 它会自动检测所有东西并为您执行测试。

如果您遇到任何问题,请添加评论。

https://github.com/octobercms/library/wiki/How-To-Use-Unit-Tests-%3F