Courses

Re-creating Booking.com API with Laravel and PHPUnit

In this lesson, we will look into migrating our PHPUnit tests to Pest which is growing in popularity. It can be done in two ways:

  • Manual
  • Semi-Automated

Manual Migration

Manual migrations can be huge but Pest is designed to make it as easy as possible. It can run a combination of tests - PHPUnit and Pest automatically. This means that you can migrate your tests one by one, or all at once.

Just follow the installation instructions and start writing new tests in Pest!


Semi-Automatic Migration

Semi-automatic migrations can be done using Laravel Shift. It doesn't cost that much (at the time of writing, $9 to convert one repository) and provides a Pull Request with the changes:

It also adds quite a few comments to your tests to help you understand what's going on:

We've tried to use Shift for this course and let's look at what it gave us.

Notice: I want you to understand correctly: you don't have to use Shift as we did, it's totally fine if you decide to perform the following changes yourself manually, for free.

Preparations

The first thing Shift did was prepared our codebase for Pest:

  • It added the pestphp/pest package to...

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

You also get:

  • 68 courses (1183 lessons, 43 h 18 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord