PHPUnit Pocket Guide

Quick Lookup and Advice

Sebastian Bergmann

This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Edition for PHPUnit 2.3. Updated on 2005-11-14.


Table of Contents

Preface
Requirements
This Book Is Free
Conventions Used in This Book
Acknowledgements
1. Automating Tests
2. PHPUnit's Goals
3. Installing PHPUnit
4. The Command-Line Test Runner
5. Fixtures
More setUp() than tearDown()
Variations
Suite-Level Setup
6. Testing Exceptions and Performance Regressions
Exceptions
Performance Regressions
7. Incomplete Tests
8. Test-First Programming
BankAccount Example
9. Code-Coverage Analysis
10. Stubs
Self-Shunting
11. Other Uses for Tests
Agile Documentation
Cross-Team Tests
Debugging Tests
Refactoring
12. PHPUnit and Phing
Formatting Feedback
13. PHPUnit's Implementation
14. PHPUnit API
Overview
PHPUnit2_Framework_Assert
PHPUnit2_Framework_Test
PHPUnit2_Framework_TestCase
PHPUnit2_Framework_TestSuite
PHPUnit2_Framework_TestResult
Package Structure
15. Extending PHPUnit
Subclass PHPUnit2_Framework_TestCase
Assert Classes
Subclass PHPUnit2_Extensions_TestDecorator
Implement PHPUnit2_Framework_Test
Subclass PHPUnit2_Framework_TestResult
Implement PHPUnit2_Framework_TestListener
New Test Runner
A. PHPUnit for PHP 4
B. Index
C. Bibliography
D. Copyright