O'Reilly logo
  • isaac peraza thinks this is interesting:

As you can see, every test case is a class. The class name should end with Test. This is because when you test your classes, the test class should mirror tested class, and the difference between the tested class and the test suite is Test added to the name:

|-- src
|   '-- library
|       '-- Util
|           '-- File.php
'-- tests
    '-- library
        '-- Util
            '-- FileTest.php

Every test class also called test suite extends the PHPUnit_Framework_TestCase class. Of course, you can write your own modified or extended PHPUnit_Fr...


Cover of PHPUnit Essentials


PHPUnit Class Test Name convention.