Factories: How to create many testing records without loops

In this lesson I will show you how to avoid loops and create many records for testing - like, if you need to create 10 products, or 1,000 companies etc.

You will see what factory is and how to use it in the tests, also how to override some of the fields, defined in the factory.

Also we will test the pagination of our Product List.

Github link to this lesson: https://github.com/LaravelDaily/Laravel-PHPUnit-Beginners-Course/tree/master/07-factories

Discussion

0 comments