Метод | Описание | |
---|---|---|
__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 |
Метод | Описание | |
---|---|---|
_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 |
Метод | Описание | |
---|---|---|
getMockHierarchyResponse ( $chainedMethodsBefore, $mockClassType, $mockClassInstanceId ) : mixed | Returns the mock hierarchy response values | |
getMockReflection ( $mockedClass ) : ReflectionClass |
public static __callStatic ( $name, $arguments ) : mixed | ||
$name | ||
$arguments | ||
Результат | mixed |
protected static _addChainedResponse ( $response ) | ||
$response |
protected static _createChainResponse ( $mockClassInstanceId, $mockClassType, $chainedMethodsBefore, $currentMethod, $args ) : null | ||
$mockClassInstanceId | ||
$mockClassType | ||
$chainedMethodsBefore | ||
$currentMethod | ||
$args | ||
Результат | null |
protected static _createResponse ( $className, $instanceId, $methodName, $arguments ) : Mixed | null | ||
$className | ||
$instanceId | ||
$methodName | ||
$arguments | ||
Результат | Mixed | null | | null |
protected static _generateInstanceId ( ) : integer | ||
Результат | integer |
protected static _isMethodStubbed ( $className, $instanceId, $methodName ) : boolean | ||
$className | ||
$instanceId | ||
$methodName | ||
Результат | boolean |
protected static _setWhenMockResponse ( $className, $instanceId, $methodName, $args, $action, $returns ) | ||
$className | ||
$instanceId | ||
$methodName | ||
$args | ||
$action | ||
$returns |
public static getReturnValues ( ) : array | ||
Результат | array |
public static partialMock ( $mockedClass ) : mixed | ||
$mockedClass | ||
Результат | mixed |
public static setReturnValues ( $returnValues ) | ||
$returnValues |
public static verify ( $mock ) : ShortifyPunit\Verify\Verify | ||
$mock | ||
Результат | ShortifyPunit\Verify\Verify |
public static when ( ShortifyPunit\Mock\MockInterface $mock ) : ShortifyPunit\Stub\WhenChainCase | ||
$mock | ShortifyPunit\Mock\MockInterface | |
Результат | ShortifyPunit\Stub\WhenChainCase |