PHP Class Neos\Flow\Tests\BaseTestCase

Don't sub class this test case but rather choose a more specialized base test case, such as UnitTestCase or FunctionalTestCase
Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$backupGlobalsBlacklist array
$backupStaticAttributes boolean Enable or disable the backup and restoration of static attributes.

Public Methods

Method Description
createMock ( string $originalClassName ) : PHPUnit_Framework_MockObject_MockObject Returns a test double for the specified class.

Protected Methods

Method Description
buildAccessibleProxy ( string $className ) : string Creates a proxy class of the specified class which allows for calling even protected methods and access of protected properties.
getAccessibleMock ( string $originalClassName, array $methods = [], array $arguments = [], string $mockClassName = '', boolean $callOriginalConstructor = true, boolean $callOriginalClone = true, boolean $callAutoload = true, boolean $cloneArguments = false, boolean $callOriginalMethods = false, object $proxyTarget = null ) : PHPUnit_Framework_MockObject_MockObject Returns a mock object which allows for calling protected methods and access of protected properties.
getAccessibleMockForAbstractClass ( string $originalClassName, array $arguments = [], string $mockClassName = '', boolean $callOriginalConstructor = true, boolean $callOriginalClone = true, boolean $callAutoload = true, array $mockedMethods = [], boolean $cloneArguments = false ) : PHPUnit_Framework_MockObject_MockObject Returns a mock object which allows for calling protected methods and access of protected properties.
inject ( object $target, string $name, mixed $dependency ) : void Injects $dependency into property $name of $target

Method Details

buildAccessibleProxy() protected method

Creates a proxy class of the specified class which allows for calling even protected methods and access of protected properties.
protected buildAccessibleProxy ( string $className ) : string
$className string Full qualified name of the original class
return string Full qualified name of the built class

createMock() public method

This can be removed as soon as we drop support for PHPUnit 4.8
public createMock ( string $originalClassName ) : PHPUnit_Framework_MockObject_MockObject
$originalClassName string
return PHPUnit_Framework_MockObject_MockObject

getAccessibleMock() protected method

Returns a mock object which allows for calling protected methods and access of protected properties.
protected getAccessibleMock ( string $originalClassName, array $methods = [], array $arguments = [], string $mockClassName = '', boolean $callOriginalConstructor = true, boolean $callOriginalClone = true, boolean $callAutoload = true, boolean $cloneArguments = false, boolean $callOriginalMethods = false, object $proxyTarget = null ) : PHPUnit_Framework_MockObject_MockObject
$originalClassName string Full qualified name of the original class
$methods array
$arguments array
$mockClassName string
$callOriginalConstructor boolean
$callOriginalClone boolean
$callAutoload boolean
$cloneArguments boolean
$callOriginalMethods boolean
$proxyTarget object
return PHPUnit_Framework_MockObject_MockObject

getAccessibleMockForAbstractClass() protected method

Returns a mock object which allows for calling protected methods and access of protected properties.
protected getAccessibleMockForAbstractClass ( string $originalClassName, array $arguments = [], string $mockClassName = '', boolean $callOriginalConstructor = true, boolean $callOriginalClone = true, boolean $callAutoload = true, array $mockedMethods = [], boolean $cloneArguments = false ) : PHPUnit_Framework_MockObject_MockObject
$originalClassName string Full qualified name of the original class
$arguments array
$mockClassName string
$callOriginalConstructor boolean
$callOriginalClone boolean
$callAutoload boolean
$mockedMethods array
$cloneArguments boolean
return PHPUnit_Framework_MockObject_MockObject

inject() protected method

This is a convenience method for setting a protected or private property in a test subject for the purpose of injecting a dependency.
protected inject ( object $target, string $name, mixed $dependency ) : void
$target object The instance which needs the dependency
$name string Name of the property to be injected
$dependency mixed The dependency to inject – usually an object but can also be any other type
return void

Property Details

$backupGlobalsBlacklist protected property

protected array $backupGlobalsBlacklist
return array

$backupStaticAttributes protected property

Enable or disable the backup and restoration of static attributes.
protected bool $backupStaticAttributes
return boolean