我是laravel的新手。我正在使用 laravel 5.4 版本,我们需要为我们的应用程序编写 phpunit 测试用例,所以我搜索了编写 phpunit 测试用例并阅读了 laravel 网站上的文档。我阅读了有关进行浏览器测试的“黄昏”功能。所以,我有一个疑问,“黄昏对于在 laravel 5.4 中编写 phpunit 测试用例是强制性的吗?我还尝试将 'dusk' 包安装到我们的应用程序中,但在我运行命令“composer”后它没有安装需要 laravel/黄昏”。
以下是我在命令提示符下遇到的错误:
c:\xampp\htdocs\ourappname>composer require laravel/dusk
using version ^1.1 for laravel/dusk
./composer.json has been updated
Loading composer repositories with package information
Updating dependies (including require-dev)
Package operations: 2 installs, 4 updates, 9 removals
- Removing maatwebsite/excel (2.1.17)
- Removing phpoffice/phpexcel (1.8.1)
- Removing jeremeamia/superclosure (2.3.0)
- Removing symfony/polyfill-php56 (v1.3.0)
- Removing symfony/polyfill-util (v1.3.0)
- Removing guzzlehttp/guzzle (6.2.3)
- Removing guzzlehttp/psr7 (1.4.2)
- Removing psr/http-message (1.0.1)
- Removing guzzlehttp/promises (v1.3.1)
- Updating psy/psysh (v0.8.3 => v0.8.5): Loading from cache
- Updating swiftmailer/swiftmailer (v5.4.7 => v5.4.8): Loading from cache
- Updating sebastian/diff (1.4.1 => 1.4.2): Loading from cache
- Updating laravel/framework (v5.4.21 => v5.4.23): Loading from cache
- Installing facebook/webdriver (1.4.1): Loading from cache
- Installing laravel/dusk (v1.1.0): Loading from cache
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Maatwebsite\Excel\ExcelServiceProvider' not found
Script php artisan optimize handling the post-update-cmd event returned with error code 1
Installation failed, reverting ./composer.json to its original content.
c:\xampp\htdocs\ourappname>
任何人请告诉我如何解决它?还有在 laravel 5.4 中编写测试用例的过程是什么?我们应该使用“黄昏”吗?或任何其他方式来做到这一点?谢谢。