Writing Tests for the Tours: Edit a Tour

Let's test the edit tour functionality.

Adding a test for editing an existing tour

Let’s write one more test, and we will leave it to you to write tests for the remaining pages of the website.

Here is a test that creates a tour, goes to the list of tours, follows the link to the edit form, updates some information, follows the link to the details page, and verifies that it shows the modified data. Because we want to remove existing data before every test in this file, this step was moved to the setUp() function. PHPUnit will call this function before every test:

Get hands-on with 1400+ tech skills courses.