In this chapter, we will take a closer look at PHPUnit and how it is handled by Codeception.
We will start with a brief introduction of the changes that we need to perform before getting into the actual tests, and from there, go through the red, green, and refactor phases to implement the tests and our code and refactor where needed.
We will introduce basic topics such as testing in isolation, integration tests of the components, and more advanced topics such as data providers.
The following topics are covered in this chapter:
Understanding the work to be done
Using the
User
modelImplementing the first unit test
Component testing of the model
Implementing the
ActiveRecord
class and its methodsSeeing test passing