O'Reilly logo

Mastering Yii by Charles R. Portwood II

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

Unit testing

The most basic type of tests we can create are called unit tests. As the name suggests, unit tests are designed to test a unit of work (whether that be a single method, function, or a larger work unit), and then check a single assumption about that unit of work. A good unit test will be composed of the following components:

  • Fully automated: A good unit test is a test that can be fully automated without human intervention.
  • Thorough: Thorough unit tests provide good coverage of the code block they are testing.
  • Independent: Good unit tests can be run in any order, and their output should have no effect or side effect on other tests that occur. Furthermore, each unit test should only test a single logical unit of code. Tests that fail should ...

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