1.Write the test class according to the document configuration, as shown in the figure:
2. Running error
3. This is how it is called in the controller
4. Run composer update and no error will be reported
世界只因有你2017-06-22 11:56:14
composer is used to manage the dependent libraries of PHP projects. Before execution, your project only contains your code. You use the laravel framework, but the code of the framework is incomplete, so an error is reported. If you execute composer update
, it will be based on The configuration of composer.json updates all dependencies (download the libraries used in the project), and the dependencies are all satisfied, so it is OK.