http://four.laravel.com/docs/testing表示"安装新的Laravel应用程序后,只需在命令行上运行phpunit即可运行测试."

phpunit isn't recognized, I also tried php artisian test and php artisan phpunit

phpunit是在某个奇怪的文件夹中,还是它实际上不包含在Laravel中?我不想安装它,如果是的话,我想安装两个.

推荐答案

随Composer一起安装

使用PHPUnit启动和运行的一个简单方法是将其包含在您的composer中(无需安装Pear,也无需将每个系统都弄得杂乱无章).json文件,比如

"phpunit/phpunit": "4.0.*",

Then after doing a composer update you'll be able to run PHPUnit from command line like this:

vend或/bin/phpunit 

Since phpunit will be installed into the vend或/bin folder.

This will install PHPUnit to this project only, not your whole system. So when you want it gone, you simply remove the line from your composer.json file, run composer update, and poof, not a trace.

Installing f或 development environments only

如果您只想在开发过程中使用它,请在"require dev"部分中添加composer行.这样,只有当您 Select 通过以下方式安装依赖于开发人员的设备时,才会安装:

php composer.phar install --dev

php composer.phar update

Laravel相关问答推荐

提交表格后如何在Livewire 3中调度模式窗口?

Laravel mail send Amazon SES不再支持TLS 1.0和TLS 1.1连接

Uncaught ReferenceError:未定义require[Shopify PHP React Browser问题]

在 blade laravel 中以格式编号显示长数字

Laravel Homestead vagrant up 超时

在 laravel 4.2 中,用户 'root'@'localhost' 的 Laravel 访问被拒绝(使用密码:YES)

Laravel Blade:@stop VS @show VS @endsection VS @append

安卓 retrofit |发布自定义对象(将 json 发送到服务器)

限制 Blade foreach 循环中的结果

路由中间的可选参数

如何修复无效请求(不支持的 SSL 请求)

Laravel 中的合同和 PHP 中的接口有什么区别?

在表单中添加一对多 - Backpack laravel

Laravel 应用程序中应用程序键的意义是什么?

Eloquent - 更新集合中的所有模型

Laravel 4 - 如何将所有字段的所有验证错误消息作为 JSON struct 返回?

为什么 BroadCastEvent 在 Laravel 中排队?如何阻止它?

升级到 laravel 5.3 后错误 datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00'

在 Laravel 4 中使用 HTML 占位符

Laravel如何仅响应没有正文消息的204代码状态