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 3.1. Updated on 2007-01-23.


Preface
Requirements
This Book Is Free
Conventions Used in This Book
Acknowledgements
1. Automating Tests
2. PHPUnit's Goals
3. Installing PHPUnit
4. Writing Tests for PHPUnit
5. The Command-Line Test Runner
6. Organizing Test Suites
7. Fixtures
More setUp() than tearDown()
Variations
Sharing Fixture
8. TestCase Extensions
Testing Exceptions
Testing Output
Testing Performance
9. Incomplete and Skipped Tests
Incomplete Tests
Skipping Tests
10. Mock Objects
Self-Shunting
Stubs
11. Testing Practices
During Development
During Debugging
12. Test-First Programming
BankAccount Example
13. Code-Coverage Analysis
14. Other Uses for Tests
Agile Documentation
Cross-Team Tests
15. Logging
XML Format
JavaScript Object Notation (JSON)
Test Anything Protocol (TAP)
GraphViz Markup
16. Skeleton Generator
Annotations
17. PHPUnit and Selenium
18. PHPUnit and Phing
Formatting Feedback
19. Continuous Integration
CruiseControl
20. PHPUnit's Implementation
21. PHPUnit API
Overview
PHPUnit_Framework_Assert
PHPUnit_Framework_Test
PHPUnit_Framework_TestCase
PHPUnit_Framework_TestSuite
PHPUnit_Framework_TestResult
Package Structure
22. Extending PHPUnit
Subclass PHPUnit_Framework_TestCase
Assert Classes
Subclass PHPUnit_Extensions_TestDecorator
Implement PHPUnit_Framework_Test
Subclass PHPUnit_Framework_TestResult
Implement PHPUnit_Framework_TestListener
New Test Runner
A. PHPUnit for PHP 4
B. Index
C. Bibliography
D. Copyright