# PHPUnit_Framework_TestCase ---- ## Mockers Code: ~~~ $this->mocker() ~~~ ### getMock() Returns a mock object for the specified class. * **param**: ... * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMock**(*string* $originalClassName [, *mixed* $methods = array() [, *array* $arguments = array() [, *string* $mockClassName = '' [, *bool* $callOriginalConstructor = TRUE [, *bool* $callOriginalClone = TRUE [, *bool* $callAutoload = TRUE]]]]]]) ### getMockForAbstractClass() Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods to mock can be specified with the last parameter. * **param**: ... * **return**: *PHPUnit_Framework_MockObject_MockObject* *PHPUnit_Framework_MockObject_MockObject* **getMockForAbstractClass**(*string* $originalClassName [, *array* $arguments = array() [, *string* $mockClassName = '' [, *bool* $callOriginalConstructor = TRUE [, *bool* $callOriginalClone = TRUE [, *bool* $callAutoload = TRUE [, *array* $mockedMethods = array()]]]]]]) ### getMockBuilder() Returns a builder object to create mock objects using a fluent interface. * **param**: *string* * **return**: *PHPUnit_Framework_MockObject_MockBuilder* *PHPUnit_Framework_MockObject_MockBuilder* **getMockBuilder**(*string* **$className**) ---- ## Matchers Code: ~~~ $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**) ---- ## Stubs Code: ~~~ $mock->will($this->stub()) ~~~ ### 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* ...])