Table of Contents
List of Examples
- 1. CardGame Class
- 2. CardGame Unit Test
- 3. CardGame Unit Test with Phake
- 1.1. Installing Phake Via Pear
- 2.1. Cool Cart
- 2.2. ShoppingCartTest
- 2.3. ShoppingCartTest Output
- 2.4. Cool Cart
- 2.5. ShoppingCartTest Output
- 2.6. ShoppingCartTest
- 2.7. ShoppingCartTest Output
- 2.8. ShoppingCartTest
- 2.9.
- 2.10.
- 2.11.
- 2.12. Stubbing a Reference Parameter
- 2.13. Conditionally Stubbing a Reference Paramter
- 2.14. A Test Class
- 2.15. Using Partial Mocks
- 2.16. Setting the default stub
- 2.17. A Magic Class
- 2.18. Implicitly Stub of __call()
- 2.19. Explicitly Stubbing __call()
- 3.1. Multiple Invocations With PHPUnit Mocks - Bad Example
- 3.2. Multiple Invocations With PHPUnit Mocks - Good Example
- 3.3. Multiple Invocations With Phake
- 3.4. Multiple Invocations of the Same Call With Phake
- 3.5. Verifying Multiple Calls in Order
- 3.6. A Magic Class
- 3.7. Implicitly Verify __call()
- 3.8. Explicitly Verify __call()
- 4.1. A class with exception logging
- 4.2. Using thenThrow() to Throw Exceptions
- 4.3. A Test Class
- 4.4. Using thenCallParent() to Force a Stub to Call its Parent
- 5.1. Dealer Strategy Interface
- 5.2. Example of Default 'Equals' Matching
- 5.3. Failed Simple Equals Test
- 5.4. Using PHPUnit Matchers
- 5.5. Using Hamcrest Matchers
- 5.6. Card Collection Interface
- 5.7. Using Argument Captors
- 5.8. Using Argument Captors With Conditions
- 5.9. Failed Test of Argument Captor
- 5.10. Custom Argument Matcher
- 6.1. Setting the Phake Client
- 6.2. Setting the Mock Class Loader