【发布时间】:2015-06-12 19:00:14
【问题描述】:
我刚刚安装了一个新的 Laravel 5 项目,这是我在这个版本上的第一个项目。 PHPUnit 应该是开箱即用的框架,我看到的每个教程都说在项目文件夹中键入 phpunit 以启动单元测试。
我检查了 PHPUnit 在 composer.json 中,我还做了一个 composer install 和 composer update 以防万一它不会在这里
website(master)$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing phpunit/phpunit (4.6.1)
- Installing phpunit/phpunit (4.6.2)
Downloading: 100%
但它根本不起作用 phpunit 根本无法识别
website(master)$ phpunit
-bash: phpunit: command not found
在我用谷歌搜索之前,似乎没有人遇到过这个问题。我希望我没有犯任何愚蠢的错误。有什么想法或建议吗?谢谢大家 ;)
【问题讨论】:
-
./vendor/bin/phpunit -
@Laurent 在您的系统上全局安装 PHPUnit 并不罕见,因此您可以在任何地方运行
phpunit -
是的,我在全球范围内安装了它,现在运行良好