PHP 클래스 phpmock\AbstractMockTest

또한 보기: Mock
저자: Markus Malkusch ([email protected])
상속: extends PHPUnit_Framework_TestCase
파일 보기 프로젝트 열기: php-mock/php-mock 1 사용 예제들

공개 메소드들

메소드 설명
provideTestBackupStaticAttributes ( ) : array Just repeat testBackupStaticAttributes a few times.
testBackupStaticAttributes ( ) Tests declaring repeatedly a mock with enabled backupStaticAttributes.
testCVariadic ( ) Tests some methods which use the varname ".
testCVariadicReset ( ) Tests some methods which use the varname ".
testDisable ( ) Tests disable().
testDisableSetup ( ) Setup a mock for testDisable().
testExplicitDefine ( ) Tests explicit function defining.
testFailEnable ( ) Tests failing enabling an already enabled mock.
testImplicitDefine ( ) Tests mocking the function implicitely defines the function.
testMockFunctionWithParameters ( ) Tests mocking a function without parameters.
testMockFunctionWithoutParameters ( ) Tests mocking a function without parameters.
testPassingByReference ( ) Test passing by reference.
testPassingByValue ( ) Tests passing by value.
testPreserveArgumentDefaultValue ( ) Tests that the mock preserves the default argument
testRedefine ( ) Tests mocking a previously mocked function again.
testResetToDefaultArgumentOfOriginalFunction ( ) Tests that the disabled mock uses the default argument of the original function.
testRunInSeparateProcess ( ) Tests the mock in a separate process.
testUndefinedFunction ( ) Tests mocking of an undefined function.

보호된 메소드들

메소드 설명
defineFunction ( string $namespace, string $functionName ) Defines the function mock.
disableMocks ( ) Disable all mocks.
mockFunction ( string $namespace, string $functionName, callable $function ) Builds an enabled function mock.
tearDown ( )

비공개 메소드들

메소드 설명
buildPrivateFunctionName ( string $name ) : string Builds a function name which is has a postfix for the current class.
escapeshellcmd ( string $command ) : string Returns the built-in call to escapeshellcmd().

메소드 상세

defineFunction() 추상적인 보호된 메소드

Defines the function mock.
abstract protected defineFunction ( string $namespace, string $functionName )
$namespace string The namespace.
$functionName string The function name.

disableMocks() 추상적인 보호된 메소드

Disable all mocks.
abstract protected disableMocks ( )

mockFunction() 추상적인 보호된 메소드

Builds an enabled function mock.
abstract protected mockFunction ( string $namespace, string $functionName, callable $function )
$namespace string The namespace.
$functionName string The function name.
$function callable The function mock.

provideTestBackupStaticAttributes() 공개 메소드

Just repeat testBackupStaticAttributes a few times.
public provideTestBackupStaticAttributes ( ) : array
리턴 array Test cases.

tearDown() 보호된 메소드

protected tearDown ( )

testBackupStaticAttributes() 공개 메소드

Tests declaring repeatedly a mock with enabled backupStaticAttributes.

testCVariadic() 공개 메소드

..".
public testCVariadic ( )

testCVariadicReset() 공개 메소드

.." after a mock was defined.
public testCVariadicReset ( )

testDisable() 공개 메소드

Tests disable().
public testDisable ( )

testDisableSetup() 공개 메소드

Setup a mock for testDisable().
public testDisableSetup ( )

testExplicitDefine() 공개 메소드

Tests explicit function defining.
public testExplicitDefine ( )

testFailEnable() 공개 메소드

Tests failing enabling an already enabled mock.
public testFailEnable ( )

testImplicitDefine() 공개 메소드

Tests mocking the function implicitely defines the function.
public testImplicitDefine ( )

testMockFunctionWithParameters() 공개 메소드

Tests mocking a function without parameters.

testMockFunctionWithoutParameters() 공개 메소드

Tests mocking a function without parameters.

testPassingByReference() 공개 메소드

Test passing by reference.

testPassingByValue() 공개 메소드

Tests passing by value.
public testPassingByValue ( )

testPreserveArgumentDefaultValue() 공개 메소드

Tests that the mock preserves the default argument

testRedefine() 공개 메소드

Tests mocking a previously mocked function again.
public testRedefine ( )

testResetToDefaultArgumentOfOriginalFunction() 공개 메소드

Tests that the disabled mock uses the default argument of the original function.

testRunInSeparateProcess() 공개 메소드

Tests the mock in a separate process.

testUndefinedFunction() 공개 메소드

Tests mocking of an undefined function.