Re-creating API with Laravel and PHPUnit

After we introduced pagination in the last lesson, we shouldn't have performance problems with loading too much data. But what about Eloquent queries in the search? Time to test their loading time.

For that, first, we need to simulate a significant amount of data, in factories/seeders.

Simulating Data with Seeders/Factories

I will go for this scenario to seed:

  • 100 countries
  • 1000 cities
  • 1000 geoobjects
  • 1000 owners and 1000 regular users
  • 100 000 properties
  • 200 000 apartments
  • 200 000 bookings with ratings and 200 000 bookings without ratings

To implement that testing scenario, I decided to create a totally separate Seeder class, that could be launched on a separate testing DB, for example...

This lesson is only for Premium Members.
Want to access all lessons of this course?

You also get:

  • 59 courses (1056 lessons, 44 h 09 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord