Methods Summary | ||
---|---|---|
public
|
#
__construct( string $name = NULL, array $data = array ( ), string $dataName = '' )
Constructs a test case with the given name.
|
|
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
#
expectExceptionObject( PHPUnit\Framework\Exception $exception )
Sets up an expectation for an exception to be raised by the code under test.
Information for expected exception class, expected exception message, and
expected exception code are retrieved from a given Exception object.
|
|
public
|
||
protected
|
||
public
|
||
protected
|
||
protected
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
protected
|
||
protected
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
#
setBackupStaticAttributes( bool $backupStaticAttributes )
Calling this method in setUp() has no effect!
|
|
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
protected
|
||
protected
|
||
public
|
#
getMockBuilder( string|string[] $className )
Returns a builder object to create mock objects using a fluent interface.
|
|
protected
|
||
protected
|
#
createConfiguredMock( string $originalClassName , array $configuration )
Returns a configured test double for the specified class.
|
|
protected
|
#
createPartialMock( string $originalClassName , array $methods )
Returns a partial test double for the specified class.
|
|
protected
|
#
createTestProxy( string $originalClassName , array $constructorArguments = array ( ) )
Returns a test proxy for the specified class.
|
|
protected
|
#
getMockClass( string $originalClassName , array $methods = array ( ), array $arguments = array ( ), string $mockClassName = '', bool $callOriginalConstructor = false, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = false )
Mocks the specified class and returns the name of the mocked class.
|
|
protected
|
#
getMockForAbstractClass( string $originalClassName , array $arguments = array ( ), string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = array ( ), bool $cloneArguments = false )
Returns a mock object for the specified abstract class with all abstract
methods of the class mocked. Concrete methods are not mocked by default.
To mock concrete methods, use the 7th parameter ($mockedMethods).
|
|
protected
|
#
getMockFromWsdl( string $wsdlFile , string $originalClassName = '', string $mockClassName = '', array $methods = array ( ), bool $callOriginalConstructor = true, array $options = array ( ) )
Returns a mock object based on the given WSDL file.
|
|
protected
|
#
getMockForTrait( string $traitName , array $arguments = array ( ), string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = array ( ), bool $cloneArguments = false )
Returns a mock object for the specified trait with all abstract methods
of the trait mocked. Concrete methods to mock can be specified with the
`$mockedMethods` parameter.
|
|
protected
|
#
getObjectForTrait( string $traitName , array $arguments = array ( ), string $traitClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true )
Returns an object for the specified trait.
|
|
protected
|
||
public
|
||
public
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public static
|
||
public
|
||
public
|
||
public
|
||
public
|
||
protected
|
||
protected
|
||
protected
|
||
public static
|
||
protected
|
||
protected
|
#
assertPreConditions( )
Performs assertions shared by all tests of a test case.
This method is called before the execution of a test starts
and after setUp() is called.
|
|
protected
|
#
assertPostConditions( )
Performs assertions shared by all tests of a test case.
This method is called before the execution of a test ends
and before tearDown() is called.
|
|
protected
|
||
public static
|
||
protected
|
#
onNotSuccessfulTest( Throwable $t )
This method is called when a test method did not execute successfully.
|
|
protected
|
#
prepareTemplate( Text_Template $template )
Performs custom preparations on the process isolation template.
|
Properties Summary | ||
---|---|---|
protected
bool
|
$backupGlobals
Enable or disable the backup and restoration of the $GLOBALS array.
Overwrite this attribute in a child class of TestCase.
Setting this attribute in setUp() has no effect!
|
#
NULL
|
protected
array
|
$backupGlobalsBlacklist
|
#
array (
)
|
protected
bool
|
$backupStaticAttributes
Enable or disable the backup and restoration of static attributes.
Overwrite this attribute in a child class of TestCase.
Setting this attribute in setUp() has no effect!
|
#
NULL
|
protected
array
|
$backupStaticAttributesBlacklist
|
#
array (
)
|
protected
bool
|
$runTestInSeparateProcess
Whether or not this test is to be run in a separate PHP process.
|
#
NULL
|
protected
bool
|
$preserveGlobalState
Whether or not this test should preserve the global state when
running in a separate PHP process.
|
#
true
|