Documentation

Configuration
in package

Table of Contents

$_allowMockingMethodsUnnecessarily  : bool
Boolean assertion of whether we ignore unnecessary mocking of methods, i.e. when method expectations are made, set using a zeroOrMoreTimes() constraint, and then never called. Essentially such expectations are not required and are just taking up test space.
$_allowMockingNonExistentMethod  : bool
Boolean assertion of whether we can mock methods which do not actually exist for the given class or object (ignored for unreal mocks)
$_constantsMap  : mixed
$_internalClassParamMap  : array<string|int, mixed>
Parameter map for use with PHP internal classes.
$_objectFormatters  : array<string|int, mixed>
Custom object formatters
$_quickDefinitionsConfiguration  : QuickDefinitionsConfiguration
$_reflectionCacheEnabled  : mixed
Boolean assertion is reflection caching enabled or not. It should be always enabled, except when using PHPUnit's --static-backup option.
__construct()  : mixed
allowMockingMethodsUnnecessarily()  : mixed
Set boolean to allow/prevent unnecessary mocking of methods
allowMockingNonExistentMethods()  : mixed
Set boolean to allow/prevent mocking of non-existent methods
disableReflectionCache()  : mixed
Disable reflection caching
enableReflectionCache()  : mixed
Enable reflection caching
getConstantsMap()  : mixed
getInternalClassMethodParamMap()  : array<string|int, mixed>|null
Get the parameter map of an internal PHP class method
getInternalClassMethodParamMaps()  : mixed
getObjectFormatter()  : mixed
getQuickDefinitions()  : QuickDefinitionsConfiguration
Returns the quick definitions configuration
mockingMethodsUnnecessarilyAllowed()  : bool
Return flag indicating whether mocking non-existent methods allowed
mockingNonExistentMethodsAllowed()  : bool
Return flag indicating whether mocking non-existent methods allowed
reflectionCacheEnabled()  : mixed
Is reflection cache enabled?
resetInternalClassMethodParamMaps()  : mixed
Remove all overridden parameter maps from internal PHP classes.
setConstantsMap()  : mixed
setInternalClassMethodParamMap()  : mixed
Set a parameter map (array of param signature strings) for the method of an internal PHP class.
setObjectFormatter()  : mixed

Properties

$_allowMockingMethodsUnnecessarily

Boolean assertion of whether we ignore unnecessary mocking of methods, i.e. when method expectations are made, set using a zeroOrMoreTimes() constraint, and then never called. Essentially such expectations are not required and are just taking up test space.

protected bool $_allowMockingMethodsUnnecessarily = true

$_allowMockingNonExistentMethod

Boolean assertion of whether we can mock methods which do not actually exist for the given class or object (ignored for unreal mocks)

protected bool $_allowMockingNonExistentMethod = true

$_internalClassParamMap

Parameter map for use with PHP internal classes.

protected array<string|int, mixed> $_internalClassParamMap = array()

$_objectFormatters

Custom object formatters

protected array<string|int, mixed> $_objectFormatters = array()

Methods

__construct()

public __construct() : mixed
Return values
mixed

allowMockingMethodsUnnecessarily()

Set boolean to allow/prevent unnecessary mocking of methods

public allowMockingMethodsUnnecessarily([bool $flag = true ]) : mixed
Parameters
$flag : bool = true
Tags
deprecated

since 1.4.0

Return values
mixed

allowMockingNonExistentMethods()

Set boolean to allow/prevent mocking of non-existent methods

public allowMockingNonExistentMethods([bool $flag = true ]) : mixed
Parameters
$flag : bool = true
Return values
mixed

getConstantsMap()

public getConstantsMap() : mixed
Return values
mixed

getInternalClassMethodParamMap()

Get the parameter map of an internal PHP class method

public getInternalClassMethodParamMap(mixed $class, mixed $method) : array<string|int, mixed>|null
Parameters
$class : mixed
$method : mixed
Return values
array<string|int, mixed>|null

getInternalClassMethodParamMaps()

public getInternalClassMethodParamMaps() : mixed
Return values
mixed

getObjectFormatter()

public getObjectFormatter(mixed $class, mixed $defaultFormatter) : mixed
Parameters
$class : mixed
$defaultFormatter : mixed
Return values
mixed

mockingMethodsUnnecessarilyAllowed()

Return flag indicating whether mocking non-existent methods allowed

public mockingMethodsUnnecessarilyAllowed() : bool
Tags
deprecated

since 1.4.0

Return values
bool

mockingNonExistentMethodsAllowed()

Return flag indicating whether mocking non-existent methods allowed

public mockingNonExistentMethodsAllowed() : bool
Return values
bool

reflectionCacheEnabled()

Is reflection cache enabled?

public reflectionCacheEnabled() : mixed
Return values
mixed

resetInternalClassMethodParamMaps()

Remove all overridden parameter maps from internal PHP classes.

public resetInternalClassMethodParamMaps() : mixed
Return values
mixed

setConstantsMap()

public setConstantsMap(array<string|int, mixed> $map) : mixed
Parameters
$map : array<string|int, mixed>
Return values
mixed

setInternalClassMethodParamMap()

Set a parameter map (array of param signature strings) for the method of an internal PHP class.

public setInternalClassMethodParamMap(string $class, string $method, array<string|int, mixed> $map) : mixed
Parameters
$class : string
$method : string
$map : array<string|int, mixed>
Return values
mixed

setObjectFormatter()

public setObjectFormatter(mixed $class, mixed $formatterCallback) : mixed
Parameters
$class : mixed
$formatterCallback : mixed
Return values
mixed

Search results