Table of Contents 1. Automating Tests ...................................................................................................... 1 2. PHPUnit's Goals ....................................................................................................... 3 3. Installing PHPUnit .................................................................................................... 5 4. Writing Tests for PHPUnit .......................................................................................... 6 Test Dependencies ................................................................................................ 6 Data Providers ...................................................................................................... 8 Testing Exceptions ................................................................................................ 9 Testing PHP Errors .............................................................................................. 12 5. The Command-Line Test Runner ................................................................................ 13 6. Fixtures .................................................................................................................. 17 More setUp() than tearDown() ............................................................................... 20 Variations .......................................................................................................... 20 Sharing Fixture ................................................................................................... 20 Global State ....................................................................................................... 21 7. Organizing Tests ..................................................................................................... 23 Composing a Test Suite Using the Filesystem .......................................................... 23 Composing a Test Suite Using XML Configuration ................................................... 24 Using the TestSuite Class ..................................................................................... 25 8. TestCase Extensions ................................................................................................. 28 Testing Output .................................................................................................... 28 9. Database Testing ..................................................................................................... 30 Data Sets ........................................................................................................... 31 Flat XML Data Set ...................................................................................... 31 XML Data Set ............................................................................................ 33 CSV Data Set ............................................................................................. 36 Replacement Data Set .................................................................................. 37 Operations .......................................................................................................... 37 Database Testing Best Practices ............................................................................. 38 10. Incomplete and Skipped Tests .................................................................................. 39 Incomplete Tests ................................................................................................. 39 Skipping Tests .................................................................................................... 40 11. Test Doubles .............................
Non ho finito di leggerlo, preferendo marcarlo come "reference" perché effettivamente andrebbe letto e contemporaneamente applicato a progetti reali man mano che si approfondiscono i concetti.
E` interessante, ma in alcune parti oscuro per chi non ha mai fatto TDD, e gli esempi pratici sono abbastanza limitati.