Phake - PHP Mocking Framework

Prev   Next

Verifying No Interaction with a Mock so Far

Occasionally you may want to ensure that no interactions have occurred with a mock object. This can be done by passing your mock object to Phake::verifyNoInteraction($mock). This will not prevent further interaction with your mock, it will simply tell you whether or not any interaction up to that point has happened. You can pass multiple arguments to this method to verify no interaction with multiple mock objects.

Prev   Next
Introduction to Phake
1. Getting Started
Support
2. Method Stubbing
Basic Method Stubbing
How Phake::when() Works
Overwriting Existing Stubs
Stubbing Multiple Calls
Stubbing Consecutive Calls
Stubbing Reference Parameters
Partial Mocks
Setting Default Stubs
Stubbing Magic Methods
3. Method Verification
Basic Method Verification
Verifying Method Parameters
Verifying Multiple Invocations
Verifying Calls Happen in a Particular Order
Verifying No Interaction with a Mock so Far
Verifying No Further Interaction with a Mock
Verifying Magic Methods
4. Answers
Throwing Exceptions
Calling the Parent
Capturing a Return Value
Custom Answers
5. Method Parameter Matchers
Using PHPUnit Matchers
Using Hamcrest Matchers
Parameter Capturing
Custom Parameter Matchers
6. Configuration
Setting the Phake Client
Setting the Mock Class Loader

Copyright © 2011 Mike Lively

This page uses the Perfect 'Left Menu' 2 Column Liquid Layout by Matthew James Taylor.