Method | Description | |
---|---|---|
__callStatic ( $name, $arguments ) : mixed | Call static function is used to detect calls to protected & private methods | |
getReturnValues ( ) : array | ||
mock ( $mockedClass ) : mixed | Mocking interfaces & classes | |
partialMock ( $mockedClass ) : mixed | Partial Mocking interfaces & classes | |
setReturnValues ( $returnValues ) | ||
spy ( $mockedClass ) | ||
verify ( $mock ) : ShortifyPunit\Verify\Verify | Verifying method interactions | |
when ( ShortifyPunit\Mock\MockInterface $mock ) : ShortifyPunit\Stub\WhenChainCase | Setting up a when case |
Method | Description | |
---|---|---|
_addChainedResponse ( $response ) | Adding chained response to ReturnValues array | |
_createChainResponse ( $mockClassInstanceId, $mockClassType, $chainedMethodsBefore, $currentMethod, $args ) : null | Setting up a chained mock response, function is called from mocked classes | |
_createResponse ( $className, $instanceId, $methodName, $arguments ) : Mixed | null | Create response is a private method which is called from the Mocked classes returns a value which was set before in the When() function otherwise returning NULL | |
_generateInstanceId ( ) : integer | Generating instance id, function is called from mocked classes | |
_isMethodStubbed ( $className, $instanceId, $methodName ) : boolean | Checking if a method with specific arguments has been stubbed | |
_setWhenMockResponse ( $className, $instanceId, $methodName, $args, $action, $returns ) | Setting up a mock response, function is called from mocked classes |
Method | Description | |
---|---|---|
getMockHierarchyResponse ( $chainedMethodsBefore, $mockClassType, $mockClassInstanceId ) : mixed | Returns the mock hierarchy response values | |
getMockReflection ( $mockedClass ) : ReflectionClass |
public static __callStatic ( $name, $arguments ) : mixed | ||
$name | ||
$arguments | ||
return | mixed |
protected static _addChainedResponse ( $response ) | ||
$response |
protected static _createChainResponse ( $mockClassInstanceId, $mockClassType, $chainedMethodsBefore, $currentMethod, $args ) : null | ||
$mockClassInstanceId | ||
$mockClassType | ||
$chainedMethodsBefore | ||
$currentMethod | ||
$args | ||
return | null |
protected static _createResponse ( $className, $instanceId, $methodName, $arguments ) : Mixed | null | ||
$className | ||
$instanceId | ||
$methodName | ||
$arguments | ||
return | Mixed | null | | null |
protected static _generateInstanceId ( ) : integer | ||
return | integer |
protected static _isMethodStubbed ( $className, $instanceId, $methodName ) : boolean | ||
$className | ||
$instanceId | ||
$methodName | ||
return | boolean |
protected static _setWhenMockResponse ( $className, $instanceId, $methodName, $args, $action, $returns ) | ||
$className | ||
$instanceId | ||
$methodName | ||
$args | ||
$action | ||
$returns |
public static partialMock ( $mockedClass ) : mixed | ||
$mockedClass | ||
return | mixed |
public static setReturnValues ( $returnValues ) | ||
$returnValues |
public static verify ( $mock ) : ShortifyPunit\Verify\Verify | ||
$mock | ||
return | ShortifyPunit\Verify\Verify |
public static when ( ShortifyPunit\Mock\MockInterface $mock ) : ShortifyPunit\Stub\WhenChainCase | ||
$mock | ShortifyPunit\Mock\MockInterface | |
return | ShortifyPunit\Stub\WhenChainCase |