O'Reilly logo

Learning Yii Testing by Matteo Pescarin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Isolated Component Testing with PHPUnit

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 model
  • Implementing the first unit test
  • Component testing of the model
  • Implementing the ActiveRecord class and its methods
  • Seeing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required