PHP Класс phpmock\AbstractMockTest

См. также: Mock
Автор: Markus Malkusch ([email protected])
Наследование: extends PHPUnit_Framework_TestCase
Показать файл Открыть проект Примеры использования класса

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

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