PHP 클래스 PHPUnit_Extension_FunctionMocker

파일 보기 프로젝트 열기: lstrojny/phpunit-function-mocker 1 사용 예제들

공개 메소드들

메소드 설명
getMock ( )
mockFunction ( $function )
start ( PHPUnit_Framework_TestCase $testCase, string $namespace ) : PHPUnit_Extension_FunctionMocker Create a mock for the given namespace to override global namespace functions.
tearDown ( )

비공개 메소드들

메소드 설명
__construct ( PHPUnit_Framework_TestCase $testCase, $namespace )

메소드 상세

getMock() 공개 메소드

public getMock ( )

mockFunction() 공개 메소드

public mockFunction ( $function )

start() 공개 정적인 메소드

Example: PHP global namespace function setcookie() needs to be overridden in order to test if a cookie gets set. When setcookie() is called from inside a class in the namespace \Foo\Bar the mock setcookie() created here will be used instead to the real function.
public static start ( PHPUnit_Framework_TestCase $testCase, string $namespace ) : PHPUnit_Extension_FunctionMocker
$testCase PHPUnit_Framework_TestCase
$namespace string
리턴 PHPUnit_Extension_FunctionMocker

tearDown() 공개 정적인 메소드

public static tearDown ( )