PHP Класс Mock, simpletest

@package SimpleTest
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

Factory for mock object classes.
public __construct ( )

generate() публичный статический Метод

Clones a class' interface and creates a mock version that can have return values and expectations set.
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

generatePartial() публичный статический Метод

Inherits the old class and chains the mock methods of an aggregated mock object.
public static generatePartial ( string $class, string $mock_class, array $methods )
$class string Class to clone.
$mock_class string New class name.
$methods array Methods to be overridden with mock versions.

getExpectationLine() публичный статический Метод

Uses a stack trace to find the line of an assertion.
public static getExpectationLine ( )