A First Test
Explore how to set up a basic test in PHPUnit to confirm your testing environment works correctly. This lesson guides you through creating a simple assertion, running tests via the terminal, and interpreting the results to ensure your PHP testing setup is functional and reliable.
We'll cover the following...
We'll cover the following...
Creating a new test file
When first installing a test runner like PHPUnit, it is a good idea to add a very simple test to show that everything is set up correctly.
Let’s start by creating a new file called tests/HomepageTest.php.
This file should contain the following code:
Running the test
In the Terminal ...