Метод | Описание | |
---|---|---|
mockGetCalls ( $method_name ) : array | Returns an array representing the invocations of $method_name in the following form: | |
mockImplementation ( $method_name, $callable ) | Replace the implementation of a method with a closure | |
mockReturn ( ) | Force the given method(s) to always return a value | |
mockReturnThis ( $method1 ) | Force the given method(s) to return $this to allow chaining | |
mockThrow ( $method_name, Exception $e ) | Throw exception when method is called |
public mockGetCalls ( $method_name ) : array | ||
$method_name | name of method to get calls for | |
Результат | array | of invocations |
public mockImplementation ( $method_name, $callable ) | ||
$method_name | Name of method to replace | |
$callable | New implementation of method. Can be a Closure, string, array(obj, method), etc. |
public mockReturn ( ) |
public mockReturnThis ( $method1 ) |
public mockThrow ( $method_name, Exception $e ) | ||
$method_name | name of method | |
$e | Exception | exception to throw |