# Setting up the expectations ## Matchers $mock->expects($this->matcher()) ### any() Returns a matcher that matches when the method it is evaluated for is executed zero or more times. * **return**: *PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount* *PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount* **any**() ### never() Returns a matcher that matches when the method it is evaluated for is never executed. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **never**() ### atLeastOnce() Returns a matcher that matches when the method it is evaluated for is executed at least once. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce* *PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce* **atLeastOnce**() ### once() Returns a matcher that matches when the method it is evaluated for is executed exactly once. * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **once**() ### exactly() Returns a matcher that matches when the method it is evaluated for is executed exactly once. * **param**: *int* * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedCount* *PHPUnit_Framework_MockObject_Matcher_InvokedCount* **exactly**(*int* **$count**) ### at() Returns a matcher that matches when the method it is evaluated for is invoked at the given $index. * **param**: *int* * **return**: *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* *PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex* **at**(*int* **$index**) ## Constraints $mock->with($this->constraint()) ### equalTo() ### logicalAnd() ### logicalNot() ### logicalOr() ### logicalXor() ## Returns $mock->will($this->return()) ### returnValue() Desc. *PHPUnit_Framework_MockObject_Stub_Return* **returnValue**(*mixed* $value) ### returnValueMap() Desc. *PHPUnit_Framework_MockObject_Stub_ReturnValue* **MapreturnValueMap**(*array* $valueMap) ### returnArgument() *PHPUnit_Framework_MockObject_Stub_ReturnArgument* **returnArgument**(*int* $argumentIndex) ### returnCallback() Desc. *PHPUnit_Framework_MockObject_Stub_ReturnCallback* **returnCallback**(*mixed* $callback) ### returnSelf() Returns the current object. *PHPUnit_Framework_MockObject_Stub_ReturnSelf* **returnSelf**() ### throwException() Desc. *PHPUnit_Framework_MockObject_Stub_Exception* **throwException**(*Exception* $exception) ### onConsecutiveCalls() Desc. *PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls* **onConsecutiveCalls**(*mixed* ... [, *mixed* ...])