[英]How to execute unit tests for octobercms/library
What is the proper way of executing unit tests for octobercms/library ? 对octobercms /图书馆执行单元测试的正确方法是什么?
I could successfully execute unit tests with the following condition. 我可以在以下条件下成功执行单元测试。
bootstrap
path in october/rain/tests/phpunit.xml to bootstrap="../../../../vendor/autoload.php"
bootstrap="../../../../vendor/autoload.php"
bootstrap
路径修改为bootstrap="../../../../vendor/autoload.php"
../../../../vendor/bin/phpunit
from october/rain/tests. ../../../../vendor/bin/phpunit
。 But, I feel like there is a better way. 但是,我觉得有更好的方法。 I wonder how other committer is executing tests.
我想知道其他提交者如何执行测试。
First of all thanks for showing interest in contributing to October CMS, 首先,感谢您有兴趣为10月的CMS做贡献,
I would say you don't need to modify a single line. 我会说您不需要修改任何一行。
first let's be specific and we only need to test octobercms/library
as we don't need to make things complex 首先让我们具体一点,我们只需要测试
octobercms/library
因为我们不需要使事情复杂化
let's assume you have working local October CMS based website on your machine.
假设您的计算机上有本地十月CMS网站。
now go to vendor\\october\\rain
folder as october lib
resides there. 现在转到
vendor\\october\\rain
october lib
所在的vendor\\october\\rain
文件夹。 (inside termial) (在终端内)
now do composer install
there 现在在这里做
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
如果您在安装中发现任何依赖关系问题(然后仅遵循此步骤) ,则在这里发现了一些依赖关系问题,因此我需要从
composer.json
删除这2个依赖关系if you find same issue then : go to "require-dev" section -> remove
如果您发现相同的问题,则:转到“ require-dev”部分->删除
1. "illuminate/routing": "5.5.*"
1. “照亮/路由”:“ 5.5。*”
2. "swiftmailer/swiftmailer": "~5.1"
2. “ swiftmailer / swiftmailer”:“〜5.1”
3. now try to install
composer install
again.3.现在尝试重新安装
composer install
。
when its done. 当它完成。
just got vendor\\october\\rain\\tests
directory (inside termial) 刚获得了
vendor\\october\\rain\\tests
目录(在终端内)
execute command for windows .\\..\\vendor\\bin\\phpunit.bat
and for linux/mac ./../vendor/bin/phpunit
对Windows
.\\..\\vendor\\bin\\phpunit.bat
和linux / mac ./../vendor/bin/phpunit
执行命令
it will automatically detect all the stuff and execute tests for you. 它会自动检测所有东西并为您执行测试。
if you face any issue please add comment. 如果您遇到任何问题,请添加评论。
https://github.com/octobercms/library/wiki/How-To-Use-Unit-Tests-%3F
https://github.com/octobercms/library/wiki/How-To-Use-Unit-Tests-%3F
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.