PHP 클래스 Mock, simpletest

@package SimpleTest
파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__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 ( )