Appendix A. Tools and tips for testing

A.1 The basics 493
A.2 Organizing tests in a directory structure 495
A.3 PHPUnit and SimpleTest assertions 496
A.4 SimpleTest web test API 498

The testing chapters in this book primarily deal with the process, principles, and logic of testing. Therefore, we’ve saved some juicy details for dessert, focusing on how to do specific things in the two most popular unit testing frameworks, SimpleTest and PHPUnit.

A.1. The basics

Basic examples of how to use SimpleTest and PHPUnit are available elsewhere, but just to make sure we get the mechanical aspects right and don’t get bogged down in some stupid error situation, we’ll do an ultra-simple example that is neither conceptually challenging nor useful. We’ll ...

Get PHP in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.