abstract class TestDoubleBuilder (View source)

Properties

protected class-string|trait-string $type
protected list<non-empty-string> $methods
protected bool $emptyMethodsArray
protected array $constructorArgs
protected bool $originalConstructor
protected bool $originalClone
protected bool $returnValueGeneration

Methods

__construct(string $type)

No description

onlyMethods(array $methods)

Specifies the subset of methods to mock, requiring each to exist in the class.

setConstructorArgs(array $arguments)

Specifies the arguments for the constructor.

disableOriginalConstructor()

Disables the invocation of the original constructor.

enableOriginalConstructor()

Enables the invocation of the original constructor.

disableOriginalClone()

Disables the invocation of the original clone constructor.

enableOriginalClone()

Enables the invocation of the original clone constructor.

getTestDouble(string|null $testDoubleClassName, bool $mockObject)

No description

Details

__construct(string $type)

No description

Parameters

string $type

TestDoubleBuilder onlyMethods(array $methods)

Specifies the subset of methods to mock, requiring each to exist in the class.

Parameters

array $methods

Return Value

TestDoubleBuilder

Exceptions

CannotUseOnlyMethodsException
ReflectionException

TestDoubleBuilder setConstructorArgs(array $arguments)

Specifies the arguments for the constructor.

Parameters

array $arguments

Return Value

TestDoubleBuilder

TestDoubleBuilder disableOriginalConstructor()

Disables the invocation of the original constructor.

Return Value

TestDoubleBuilder

TestDoubleBuilder enableOriginalConstructor()

Enables the invocation of the original constructor.

Return Value

TestDoubleBuilder

TestDoubleBuilder disableOriginalClone()

Disables the invocation of the original clone constructor.

Return Value

TestDoubleBuilder

TestDoubleBuilder enableOriginalClone()

Enables the invocation of the original clone constructor.

Return Value

TestDoubleBuilder

TestDoubleBuilder enableAutoReturnValueGeneration()

No description

Return Value

TestDoubleBuilder

TestDoubleBuilder disableAutoReturnValueGeneration()

No description

Return Value

TestDoubleBuilder

protected MockObject|Stub getTestDouble(string|null $testDoubleClassName, bool $mockObject)

No description

Parameters

string|null $testDoubleClassName
bool $mockObject

Return Value

MockObject|Stub