Метод | Описание | |
---|---|---|
__construct ( ) | Factory for mock object classes. | |
generate ( string $class, string $mock_class = false, array $methods = false ) | Clones a class' interface and creates a mock version that can have return values and expectations set. | |
generatePartial ( string $class, string $mock_class, array $methods ) | Generates a version of a class with selected methods mocked only. | |
getExpectationLine ( ) | Uses a stack trace to find the line of an assertion. |
public static generate ( string $class, string $mock_class = false, array $methods = false ) | ||
$class | string | Class to clone. |
$mock_class | string | New class name. Default is the old name with "Mock" prepended. |
$methods | array | Additional methods to add beyond those in the cloned class. Use this to emulate the dynamic addition of methods in the cloned class or when the class hasn't been written yet.sta |
public static getExpectationLine ( ) |