Documentation

PHP_Token_NamespaceTest extends PHPUnit_Framework_TestCase
in package

Tests for the PHP_Token_NAMESPACE class.

Tags
subpackage

Tests

author

Sebastian Bergmann sebastian@phpunit.de

copyright

Sebastian Bergmann sebastian@phpunit.de

license

http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License

version

Release: @package_version@

link
http://github.com/sebastianbergmann/php-token-stream/
since

Class available since Release 1.0.0

Table of Contents

$backupGlobals  : bool
Enable or disable the backup and restoration of the $GLOBALS array.
$backupGlobalsBlacklist  : array<string|int, mixed>
$backupStaticAttributes  : bool
Enable or disable the backup and restoration of static attributes.
$backupStaticAttributesBlacklist  : array<string|int, mixed>
$preserveGlobalState  : bool
Whether or not this test should preserve the global state when running in a separate PHP process.
$runTestInSeparateProcess  : bool
Whether or not this test is to be run in a separate PHP process.
$count  : int
$data  : array<string|int, mixed>
$dataName  : string
$dependencies  : array<string|int, mixed>
$dependencyInput  : array<string|int, mixed>
$disallowChangesToGlobalState  : bool
$expectedException  : mixed
The name of the expected Exception.
$expectedExceptionCode  : int
The code of the expected Exception.
$expectedExceptionMessage  : string
The message of the expected Exception.
$expectedExceptionMessageRegExp  : string
The regex pattern to validate the expected Exception message.
$iniSettings  : array<string|int, mixed>
$inIsolation  : bool
Whether or not this test is running in a separate PHP process.
$locale  : array<string|int, mixed>
$mockObjectGenerator  : array<string|int, mixed>
$mockObjects  : array<string|int, mixed>
$name  : string
The name of the test case.
$numAssertions  : int
$output  : string
$outputBufferingActive  : bool
$outputBufferingLevel  : int
$outputCallback  : mixed
$outputExpectedRegex  : string
$outputExpectedString  : string
$prophet  : Prophet
$result  : PHPUnit_Framework_TestResult
$snapshot  : Snapshot
$status  : int
$statusMessage  : string
$testResult  : mixed
$useErrorHandler  : bool
__construct()  : mixed
Constructs a test case with the given name.
addToAssertionCount()  : mixed
Adds a value to the assertion counter.
any()  : PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount
Returns a matcher that matches when the method is executed zero or more times.
anything()  : PHPUnit_Framework_Constraint_IsAnything
Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.
arrayHasKey()  : PHPUnit_Framework_Constraint_ArrayHasKey
Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object.
assertArrayHasKey()  : mixed
Asserts that an array has a specified key.
assertArrayNotHasKey()  : mixed
Asserts that an array does not have a specified key.
assertArraySubset()  : mixed
Asserts that an array has a specified subset.
assertAttributeContains()  : mixed
Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object contains a needle.
assertAttributeContainsOnly()  : mixed
Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object contains only values of a given type.
assertAttributeCount()  : mixed
Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute.
assertAttributeEmpty()  : mixed
Asserts that a static attribute of a class or an attribute of an object is empty.
assertAttributeEquals()  : mixed
Asserts that a variable is equal to an attribute of an object.
assertAttributeGreaterThan()  : mixed
Asserts that an attribute is greater than another value.
assertAttributeGreaterThanOrEqual()  : mixed
Asserts that an attribute is greater than or equal to another value.
assertAttributeInstanceOf()  : mixed
Asserts that an attribute is of a given type.
assertAttributeInternalType()  : mixed
Asserts that an attribute is of a given type.
assertAttributeLessThan()  : mixed
Asserts that an attribute is smaller than another value.
assertAttributeLessThanOrEqual()  : mixed
Asserts that an attribute is smaller than or equal to another value.
assertAttributeNotContains()  : mixed
Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object does not contain a needle.
assertAttributeNotContainsOnly()  : mixed
Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object does not contain only values of a given type.
assertAttributeNotCount()  : mixed
Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute.
assertAttributeNotEmpty()  : mixed
Asserts that a static attribute of a class or an attribute of an object is not empty.
assertAttributeNotEquals()  : mixed
Asserts that a variable is not equal to an attribute of an object.
assertAttributeNotInstanceOf()  : mixed
Asserts that an attribute is of a given type.
assertAttributeNotInternalType()  : mixed
Asserts that an attribute is of a given type.
assertAttributeNotSame()  : mixed
Asserts that a variable and an attribute of an object do not have the same type and value.
assertAttributeSame()  : mixed
Asserts that a variable and an attribute of an object have the same type and value.
assertClassHasAttribute()  : mixed
Asserts that a class has a specified attribute.
assertClassHasStaticAttribute()  : mixed
Asserts that a class has a specified static attribute.
assertClassNotHasAttribute()  : mixed
Asserts that a class does not have a specified attribute.
assertClassNotHasStaticAttribute()  : mixed
Asserts that a class does not have a specified static attribute.
assertContains()  : mixed
Asserts that a haystack contains a needle.
assertContainsOnly()  : mixed
Asserts that a haystack contains only values of a given type.
assertContainsOnlyInstancesOf()  : mixed
Asserts that a haystack contains only instances of a given classname
assertCount()  : mixed
Asserts the number of elements of an array, Countable or Traversable.
assertEmpty()  : mixed
Asserts that a variable is empty.
assertEquals()  : mixed
Asserts that two variables are equal.
assertEqualXMLStructure()  : mixed
Asserts that a hierarchy of DOMElements matches.
assertFalse()  : mixed
Asserts that a condition is false.
assertFileEquals()  : mixed
Asserts that the contents of one file is equal to the contents of another file.
assertFileExists()  : mixed
Asserts that a file exists.
assertFileNotEquals()  : mixed
Asserts that the contents of one file is not equal to the contents of another file.
assertFileNotExists()  : mixed
Asserts that a file does not exist.
assertGreaterThan()  : mixed
Asserts that a value is greater than another value.
assertGreaterThanOrEqual()  : mixed
Asserts that a value is greater than or equal to another value.
assertInstanceOf()  : mixed
Asserts that a variable is of a given type.
assertInternalType()  : mixed
Asserts that a variable is of a given type.
assertJson()  : mixed
Asserts that a string is a valid JSON string.
assertJsonFileEqualsJsonFile()  : mixed
Asserts that two JSON files are equal.
assertJsonFileNotEqualsJsonFile()  : mixed
Asserts that two JSON files are not equal.
assertJsonStringEqualsJsonFile()  : mixed
Asserts that the generated JSON encoded object and the content of the given file are equal.
assertJsonStringEqualsJsonString()  : mixed
Asserts that two given JSON encoded objects or arrays are equal.
assertJsonStringNotEqualsJsonFile()  : mixed
Asserts that the generated JSON encoded object and the content of the given file are not equal.
assertJsonStringNotEqualsJsonString()  : mixed
Asserts that two given JSON encoded objects or arrays are not equal.
assertLessThan()  : mixed
Asserts that a value is smaller than another value.
assertLessThanOrEqual()  : mixed
Asserts that a value is smaller than or equal to another value.
assertNotContains()  : mixed
Asserts that a haystack does not contain a needle.
assertNotContainsOnly()  : mixed
Asserts that a haystack does not contain only values of a given type.
assertNotCount()  : mixed
Asserts the number of elements of an array, Countable or Traversable.
assertNotEmpty()  : mixed
Asserts that a variable is not empty.
assertNotEquals()  : mixed
Asserts that two variables are not equal.
assertNotFalse()  : mixed
Asserts that a condition is not false.
assertNotInstanceOf()  : mixed
Asserts that a variable is not of a given type.
assertNotInternalType()  : mixed
Asserts that a variable is not of a given type.
assertNotNull()  : mixed
Asserts that a variable is not null.
assertNotRegExp()  : mixed
Asserts that a string does not match a given regular expression.
assertNotSame()  : mixed
Asserts that two variables do not have the same type and value.
assertNotSameSize()  : mixed
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same.
assertNotTag()  : mixed
This assertion is the exact opposite of assertTag().
assertNotTrue()  : mixed
Asserts that a condition is not true.
assertNull()  : mixed
Asserts that a variable is null.
assertObjectHasAttribute()  : mixed
Asserts that an object has a specified attribute.
assertObjectNotHasAttribute()  : mixed
Asserts that an object does not have a specified attribute.
assertRegExp()  : mixed
Asserts that a string matches a given regular expression.
assertSame()  : mixed
Asserts that two variables have the same type and value.
assertSameSize()  : mixed
Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same.
assertSelectCount()  : mixed
Assert the presence, absence, or count of elements in a document matching the CSS $selector, regardless of the contents of those elements.
assertSelectEquals()  : mixed
assertSelectEquals("#binder .name", "Chuck", true, $xml); // any? assertSelectEquals("#binder .name", "Chuck", false, $xml); // none?
assertSelectRegExp()  : mixed
assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any? assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml); // 3?
assertStringEndsNotWith()  : mixed
Asserts that a string ends not with a given suffix.
assertStringEndsWith()  : mixed
Asserts that a string ends with a given suffix.
assertStringEqualsFile()  : mixed
Asserts that the contents of a string is equal to the contents of a file.
assertStringMatchesFormat()  : mixed
Asserts that a string matches a given format string.
assertStringMatchesFormatFile()  : mixed
Asserts that a string matches a given format file.
assertStringNotEqualsFile()  : mixed
Asserts that the contents of a string is not equal to the contents of a file.
assertStringNotMatchesFormat()  : mixed
Asserts that a string does not match a given format string.
assertStringNotMatchesFormatFile()  : mixed
Asserts that a string does not match a given format string.
assertStringStartsNotWith()  : mixed
Asserts that a string starts not with a given prefix.
assertStringStartsWith()  : mixed
Asserts that a string starts with a given prefix.
assertTag()  : mixed
Evaluate an HTML or XML string and assert its structure and/or contents.
assertThat()  : mixed
Evaluates a PHPUnit_Framework_Constraint matcher object.
assertTrue()  : mixed
Asserts that a condition is true.
assertXmlFileEqualsXmlFile()  : mixed
Asserts that two XML files are equal.
assertXmlFileNotEqualsXmlFile()  : mixed
Asserts that two XML files are not equal.
assertXmlStringEqualsXmlFile()  : mixed
Asserts that two XML documents are equal.
assertXmlStringEqualsXmlString()  : mixed
Asserts that two XML documents are equal.
assertXmlStringNotEqualsXmlFile()  : mixed
Asserts that two XML documents are not equal.
assertXmlStringNotEqualsXmlString()  : mixed
Asserts that two XML documents are not equal.
at()  : PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
Returns a matcher that matches when the method is executed at the given index.
atLeast()  : PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastCount
Returns a matcher that matches when the method is executed at least N times.
atLeastOnce()  : PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
Returns a matcher that matches when the method is executed at least once.
atMost()  : PHPUnit_Framework_MockObject_Matcher_InvokedAtMostCount
Returns a matcher that matches when the method is executed at most N times.
attribute()  : PHPUnit_Framework_Constraint_Attribute
Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
attributeEqualTo()  : PHPUnit_Framework_Constraint_Attribute
Returns a PHPUnit_Framework_Constraint_IsEqual matcher object that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher object.
callback()  : PHPUnit_Framework_Constraint_Callback
Returns a PHPUnit_Framework_Constraint_Callback matcher object.
classHasAttribute()  : PHPUnit_Framework_Constraint_ClassHasAttribute
Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.
classHasStaticAttribute()  : PHPUnit_Framework_Constraint_ClassHasStaticAttribute
Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher object.
contains()  : PHPUnit_Framework_Constraint_TraversableContains
Returns a PHPUnit_Framework_Constraint_TraversableContains matcher object.
containsOnly()  : PHPUnit_Framework_Constraint_TraversableContainsOnly
Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher object.
containsOnlyInstancesOf()  : PHPUnit_Framework_Constraint_TraversableContainsOnly
Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher object.
count()  : int
Counts the number of test cases executed by run(TestResult result).
countOf()  : PHPUnit_Framework_Constraint_Count
Returns a PHPUnit_Framework_Constraint_Count matcher object.
equalTo()  : PHPUnit_Framework_Constraint_IsEqual
Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.
exactly()  : PHPUnit_Framework_MockObject_Matcher_InvokedCount
Returns a matcher that matches when the method is executed exactly $count times.
expectOutputRegex()  : mixed
expectOutputString()  : mixed
fail()  : mixed
Fails a test with the given message.
fileExists()  : PHPUnit_Framework_Constraint_FileExists
Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
getActualOutput()  : string
getAnnotations()  : array<string|int, mixed>
Returns the annotations for this test.
getCount()  : int
Return the current assertion count.
getExpectedException()  : string
getMock()  : PHPUnit_Framework_MockObject_MockObject
Returns a mock object for the specified class.
getMockBuilder()  : PHPUnit_Framework_MockObject_MockBuilder
Returns a builder object to create mock objects using a fluent interface.
getMockForAbstractClass()  : PHPUnit_Framework_MockObject_MockObject
Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default.
getMockForTrait()  : PHPUnit_Framework_MockObject_MockObject
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.
getName()  : string
Gets the name of a TestCase.
getNumAssertions()  : int
Returns the number of assertions performed by this test.
getObjectAttribute()  : mixed
Returns the value of an object's attribute.
getResult()  : mixed
getSize()  : int
Returns the size of the test.
getStaticAttribute()  : mixed
Returns the value of a static attribute.
getStatus()  : int
Returns the status of this test.
getStatusMessage()  : string
Returns the status message of this test.
getTestResultObject()  : PHPUnit_Framework_TestResult
greaterThan()  : PHPUnit_Framework_Constraint_GreaterThan
Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.
greaterThanOrEqual()  : PHPUnit_Framework_Constraint_Or
Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps a PHPUnit_Framework_Constraint_IsEqual and a PHPUnit_Framework_Constraint_GreaterThan matcher object.
hasDependencies()  : bool
Returns true if the tests has dependencies
hasExpectationOnOutput()  : bool
hasFailed()  : bool
Returns whether or not this test has failed.
hasOutput()  : bool
hasPerformedExpectationsOnOutput()  : bool
identicalTo()  : PHPUnit_Framework_Constraint_IsIdentical
Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.
isEmpty()  : PHPUnit_Framework_Constraint_IsEmpty
Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.
isFalse()  : PHPUnit_Framework_Constraint_IsFalse
Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.
isInIsolation()  : bool
isInstanceOf()  : PHPUnit_Framework_Constraint_IsInstanceOf
Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.
isJson()  : PHPUnit_Framework_Constraint_IsJson
Returns a PHPUnit_Framework_Constraint_IsJson matcher object.
isNull()  : PHPUnit_Framework_Constraint_IsNull
Returns a PHPUnit_Framework_Constraint_IsNull matcher object.
isTrue()  : PHPUnit_Framework_Constraint_IsTrue
Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.
isType()  : PHPUnit_Framework_Constraint_IsType
Returns a PHPUnit_Framework_Constraint_IsType matcher object.
lessThan()  : PHPUnit_Framework_Constraint_LessThan
Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
lessThanOrEqual()  : PHPUnit_Framework_Constraint_Or
Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps a PHPUnit_Framework_Constraint_IsEqual and a PHPUnit_Framework_Constraint_LessThan matcher object.
logicalAnd()  : PHPUnit_Framework_Constraint_And
Returns a PHPUnit_Framework_Constraint_And matcher object.
logicalNot()  : PHPUnit_Framework_Constraint_Not
Returns a PHPUnit_Framework_Constraint_Not matcher object.
logicalOr()  : PHPUnit_Framework_Constraint_Or
Returns a PHPUnit_Framework_Constraint_Or matcher object.
logicalXor()  : PHPUnit_Framework_Constraint_Xor
Returns a PHPUnit_Framework_Constraint_Xor matcher object.
markTestIncomplete()  : mixed
Mark the test as incomplete.
markTestSkipped()  : mixed
Mark the test as skipped.
matches()  : PHPUnit_Framework_Constraint_StringMatches
Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
matchesRegularExpression()  : PHPUnit_Framework_Constraint_PCREMatch
Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.
never()  : PHPUnit_Framework_MockObject_Matcher_InvokedCount
Returns a matcher that matches when the method is never executed.
objectHasAttribute()  : PHPUnit_Framework_Constraint_ObjectHasAttribute
Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.
once()  : PHPUnit_Framework_MockObject_Matcher_InvokedCount
Returns a matcher that matches when the method is executed exactly once.
onConsecutiveCalls()  : PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
readAttribute()  : mixed
Returns the value of an attribute of a class or an object.
resetCount()  : mixed
Reset the assertion counter.
returnArgument()  : PHPUnit_Framework_MockObject_Stub_ReturnArgument
returnCallback()  : PHPUnit_Framework_MockObject_Stub_ReturnCallback
returnSelf()  : PHPUnit_Framework_MockObject_Stub_ReturnSelf
Returns the current object.
returnValue()  : PHPUnit_Framework_MockObject_Stub_Return
returnValueMap()  : PHPUnit_Framework_MockObject_Stub_ReturnValueMap
run()  : PHPUnit_Framework_TestResult
Runs the test case and collects the results in a TestResult object.
runBare()  : mixed
Runs the bare test sequence.
setBackupGlobals()  : mixed
Calling this method in setUp() has no effect!
setBackupStaticAttributes()  : mixed
Calling this method in setUp() has no effect!
setDependencies()  : mixed
Sets the dependencies of a TestCase.
setDependencyInput()  : mixed
Sets
setDisallowChangesToGlobalState()  : mixed
setExpectedException()  : mixed
setExpectedExceptionRegExp()  : mixed
setInIsolation()  : mixed
setName()  : mixed
Sets the name of a TestCase.
setOutputCallback()  : mixed
setPreserveGlobalState()  : mixed
setResult()  : mixed
setRunTestInSeparateProcess()  : mixed
setTestResultObject()  : mixed
setUpBeforeClass()  : mixed
This method is called before the first test of this test class is run.
setUseErrorHandler()  : mixed
stringContains()  : PHPUnit_Framework_Constraint_StringContains
Returns a PHPUnit_Framework_Constraint_StringContains matcher object.
stringEndsWith()  : PHPUnit_Framework_Constraint_StringEndsWith
Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
stringStartsWith()  : PHPUnit_Framework_Constraint_StringStartsWith
Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.
tearDownAfterClass()  : mixed
This method is called after the last test of this test class is run.
testGetEndLineWithScopedNamespace()  : mixed
testGetEndLineWithUnscopedNamespace()  : mixed
testGetName()  : mixed
testGetStartLineWithScopedNamespace()  : mixed
testGetStartLineWithUnscopedNamespace()  : mixed
throwException()  : PHPUnit_Framework_MockObject_Stub_Exception
toString()  : string
Returns a string representation of the test case.
assertPostConditions()  : mixed
Performs assertions shared by all tests of a test case.
assertPreConditions()  : mixed
Performs assertions shared by all tests of a test case.
checkRequirements()  : mixed
createResult()  : PHPUnit_Framework_TestResult
Creates a default TestResult object.
getDataSetAsString()  : string
Gets the data set description of a TestCase.
getMockClass()  : string
Mocks the specified class and returns the name of the mocked class.
getMockFromWsdl()  : PHPUnit_Framework_MockObject_MockObject
Returns a mock object based on the given WSDL file.
getMockObjectGenerator()  : PHPUnit_Framework_MockObject_Generator
Get the mock object generator, creating it if it doesn't exist.
getObjectForTrait()  : object
Returns an object for the specified trait.
handleDependencies()  : mixed
iniSet()  : mixed
This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run.
onNotSuccessfulTest()  : mixed
This method is called when a test method did not execute successfully.
prepareTemplate()  : mixed
Performs custom preparations on the process isolation template.
prophesize()  : ObjectProphecy
runTest()  : mixed
Override to run the test and assert its state.
setExpectedExceptionFromAnnotation()  : mixed
setLocale()  : mixed
This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.
setUp()  : mixed
Sets up the fixture, for example, open a network connection.
setUseErrorHandlerFromAnnotation()  : mixed
tearDown()  : mixed
Tears down the fixture, for example, close a network connection.
verifyMockObjects()  : mixed
Verifies the mock object expectations.
compareGlobalStateSnapshotPart()  : mixed
compareGlobalStateSnapshots()  : mixed
createGlobalStateSnapshot()  : Snapshot
getProphet()  : Prophet
restoreGlobalState()  : mixed
snapshotGlobalState()  : mixed
startOutputBuffering()  : mixed
stopOutputBuffering()  : mixed

Properties

$backupGlobals

Enable or disable the backup and restoration of the $GLOBALS array.

protected bool $backupGlobals = ull

Overwrite this attribute in a child class of TestCase. Setting this attribute in setUp() has no effect!

$backupGlobalsBlacklist

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

$backupStaticAttributes

Enable or disable the backup and restoration of static attributes.

protected bool $backupStaticAttributes = ull

Overwrite this attribute in a child class of TestCase. Setting this attribute in setUp() has no effect!

$backupStaticAttributesBlacklist

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

$preserveGlobalState

Whether or not this test should preserve the global state when running in a separate PHP process.

protected bool $preserveGlobalState = rue

$runTestInSeparateProcess

Whether or not this test is to be run in a separate PHP process.

protected bool $runTestInSeparateProcess = ull

$count

private static int $count = 0

$data

private array<string|int, mixed> $data = array()

$dataName

private string $dataName = ''

$dependencies

private array<string|int, mixed> $dependencies = array()

$dependencyInput

private array<string|int, mixed> $dependencyInput = array()

$disallowChangesToGlobalState

private bool $disallowChangesToGlobalState = alse

$expectedException

The name of the expected Exception.

private mixed $expectedException = ull

$expectedExceptionCode

The code of the expected Exception.

private int $expectedExceptionCode

$expectedExceptionMessage

The message of the expected Exception.

private string $expectedExceptionMessage = ''

$expectedExceptionMessageRegExp

The regex pattern to validate the expected Exception message.

private string $expectedExceptionMessageRegExp = ''

$iniSettings

private array<string|int, mixed> $iniSettings = array()

$inIsolation

Whether or not this test is running in a separate PHP process.

private bool $inIsolation = alse

$locale

private array<string|int, mixed> $locale = array()

$mockObjectGenerator

private array<string|int, mixed> $mockObjectGenerator = ull

$mockObjects

private array<string|int, mixed> $mockObjects = array()

$name

The name of the test case.

private string $name = ull

$numAssertions

private int $numAssertions = 0

$outputBufferingActive

private bool $outputBufferingActive = alse

$outputBufferingLevel

private int $outputBufferingLevel

$outputCallback

private mixed $outputCallback = alse

$outputExpectedRegex

private string $outputExpectedRegex = ull

$outputExpectedString

private string $outputExpectedString = ull

$statusMessage

private string $statusMessage = ''

$useErrorHandler

private bool $useErrorHandler = ull

Methods

__construct()

Constructs a test case with the given name.

public __construct([string $name = null ][, array<string|int, mixed> $data = array() ][, string $dataName = '' ]) : mixed
Parameters
$name : string = null
$data : array<string|int, mixed> = array()
$dataName : string = ''
Return values
mixed

addToAssertionCount()

Adds a value to the assertion counter.

public addToAssertionCount(int $count) : mixed
Parameters
$count : int
Tags
since

Method available since Release 3.3.3

Return values
mixed

assertArrayHasKey()

Asserts that an array has a specified key.

public static assertArrayHasKey(mixed $key, array<string|int, mixed>|ArrayAccess $array[, string $message = '' ]) : mixed
Parameters
$key : mixed
$array : array<string|int, mixed>|ArrayAccess
$message : string = ''
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertArrayNotHasKey()

Asserts that an array does not have a specified key.

public static assertArrayNotHasKey(mixed $key, array<string|int, mixed>|ArrayAccess $array[, string $message = '' ]) : mixed
Parameters
$key : mixed
$array : array<string|int, mixed>|ArrayAccess
$message : string = ''
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertArraySubset()

Asserts that an array has a specified subset.

public static assertArraySubset(array<string|int, mixed>|ArrayAccess $subset, array<string|int, mixed>|ArrayAccess $array[, bool $strict = false ][, string $message = '' ]) : mixed
Parameters
$subset : array<string|int, mixed>|ArrayAccess
$array : array<string|int, mixed>|ArrayAccess
$strict : bool = false

Check for object identity

$message : string = ''
Tags
since

Method available since Release 4.4.0

Return values
mixed

assertAttributeContains()

Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object contains a needle.

public static assertAttributeContains(mixed $needle, string $haystackAttributeName, mixed $haystackClassOrObject[, string $message = '' ][, bool $ignoreCase = false ][, bool $checkForObjectIdentity = true ][, bool $checkForNonObjectIdentity = false ]) : mixed
Parameters
$needle : mixed
$haystackAttributeName : string
$haystackClassOrObject : mixed
$message : string = ''
$ignoreCase : bool = false
$checkForObjectIdentity : bool = true
$checkForNonObjectIdentity : bool = false
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertAttributeContainsOnly()

Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object contains only values of a given type.

public static assertAttributeContainsOnly(string $type, string $haystackAttributeName, mixed $haystackClassOrObject[, bool $isNativeType = null ][, string $message = '' ]) : mixed
Parameters
$type : string
$haystackAttributeName : string
$haystackClassOrObject : mixed
$isNativeType : bool = null
$message : string = ''
Tags
since

Method available since Release 3.1.4

Return values
mixed

assertAttributeCount()

Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute.

public static assertAttributeCount(int $expectedCount, string $haystackAttributeName, mixed $haystackClassOrObject[, string $message = '' ]) : mixed
Parameters
$expectedCount : int
$haystackAttributeName : string
$haystackClassOrObject : mixed
$message : string = ''
Tags
since

Method available since Release 3.6.0

Return values
mixed

assertAttributeEmpty()

Asserts that a static attribute of a class or an attribute of an object is empty.

public static assertAttributeEmpty(string $haystackAttributeName, mixed $haystackClassOrObject[, string $message = '' ]) : mixed
Parameters
$haystackAttributeName : string
$haystackClassOrObject : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertAttributeEquals()

Asserts that a variable is equal to an attribute of an object.

public static assertAttributeEquals(mixed $expected, string $actualAttributeName, string $actualClassOrObject[, string $message = '' ][, float $delta = 0.0 ][, int $maxDepth = 10 ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expected : mixed
$actualAttributeName : string
$actualClassOrObject : string
$message : string = ''
$delta : float = 0.0
$maxDepth : int = 10
$canonicalize : bool = false
$ignoreCase : bool = false
Return values
mixed

assertAttributeGreaterThan()

Asserts that an attribute is greater than another value.

public static assertAttributeGreaterThan(mixed $expected, string $actualAttributeName, string $actualClassOrObject[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actualAttributeName : string
$actualClassOrObject : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertAttributeGreaterThanOrEqual()

Asserts that an attribute is greater than or equal to another value.

public static assertAttributeGreaterThanOrEqual(mixed $expected, string $actualAttributeName, string $actualClassOrObject[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actualAttributeName : string
$actualClassOrObject : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertAttributeInstanceOf()

Asserts that an attribute is of a given type.

public static assertAttributeInstanceOf(string $expected, string $attributeName, mixed $classOrObject[, string $message = '' ]) : mixed
Parameters
$expected : string
$attributeName : string
$classOrObject : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertAttributeInternalType()

Asserts that an attribute is of a given type.

public static assertAttributeInternalType(string $expected, string $attributeName, mixed $classOrObject[, string $message = '' ]) : mixed
Parameters
$expected : string
$attributeName : string
$classOrObject : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertAttributeLessThan()

Asserts that an attribute is smaller than another value.

public static assertAttributeLessThan(mixed $expected, string $actualAttributeName, string $actualClassOrObject[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actualAttributeName : string
$actualClassOrObject : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertAttributeLessThanOrEqual()

Asserts that an attribute is smaller than or equal to another value.

public static assertAttributeLessThanOrEqual(mixed $expected, string $actualAttributeName, string $actualClassOrObject[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actualAttributeName : string
$actualClassOrObject : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertAttributeNotContains()

Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object does not contain a needle.

public static assertAttributeNotContains(mixed $needle, string $haystackAttributeName, mixed $haystackClassOrObject[, string $message = '' ][, bool $ignoreCase = false ][, bool $checkForObjectIdentity = true ][, bool $checkForNonObjectIdentity = false ]) : mixed
Parameters
$needle : mixed
$haystackAttributeName : string
$haystackClassOrObject : mixed
$message : string = ''
$ignoreCase : bool = false
$checkForObjectIdentity : bool = true
$checkForNonObjectIdentity : bool = false
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertAttributeNotContainsOnly()

Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object does not contain only values of a given type.

public static assertAttributeNotContainsOnly(string $type, string $haystackAttributeName, mixed $haystackClassOrObject[, bool $isNativeType = null ][, string $message = '' ]) : mixed
Parameters
$type : string
$haystackAttributeName : string
$haystackClassOrObject : mixed
$isNativeType : bool = null
$message : string = ''
Tags
since

Method available since Release 3.1.4

Return values
mixed

assertAttributeNotCount()

Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute.

public static assertAttributeNotCount(int $expectedCount, string $haystackAttributeName, mixed $haystackClassOrObject[, string $message = '' ]) : mixed
Parameters
$expectedCount : int
$haystackAttributeName : string
$haystackClassOrObject : mixed
$message : string = ''
Tags
since

Method available since Release 3.6.0

Return values
mixed

assertAttributeNotEmpty()

Asserts that a static attribute of a class or an attribute of an object is not empty.

public static assertAttributeNotEmpty(string $haystackAttributeName, mixed $haystackClassOrObject[, string $message = '' ]) : mixed
Parameters
$haystackAttributeName : string
$haystackClassOrObject : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertAttributeNotEquals()

Asserts that a variable is not equal to an attribute of an object.

public static assertAttributeNotEquals(mixed $expected, string $actualAttributeName, string $actualClassOrObject[, string $message = '' ][, float $delta = 0.0 ][, int $maxDepth = 10 ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expected : mixed
$actualAttributeName : string
$actualClassOrObject : string
$message : string = ''
$delta : float = 0.0
$maxDepth : int = 10
$canonicalize : bool = false
$ignoreCase : bool = false
Return values
mixed

assertAttributeNotInstanceOf()

Asserts that an attribute is of a given type.

public static assertAttributeNotInstanceOf(string $expected, string $attributeName, mixed $classOrObject[, string $message = '' ]) : mixed
Parameters
$expected : string
$attributeName : string
$classOrObject : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertAttributeNotInternalType()

Asserts that an attribute is of a given type.

public static assertAttributeNotInternalType(string $expected, string $attributeName, mixed $classOrObject[, string $message = '' ]) : mixed
Parameters
$expected : string
$attributeName : string
$classOrObject : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertAttributeNotSame()

Asserts that a variable and an attribute of an object do not have the same type and value.

public static assertAttributeNotSame(mixed $expected, string $actualAttributeName, object $actualClassOrObject[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actualAttributeName : string
$actualClassOrObject : object
$message : string = ''
Return values
mixed

assertAttributeSame()

Asserts that a variable and an attribute of an object have the same type and value.

public static assertAttributeSame(mixed $expected, string $actualAttributeName, object $actualClassOrObject[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actualAttributeName : string
$actualClassOrObject : object
$message : string = ''
Return values
mixed

assertClassHasAttribute()

Asserts that a class has a specified attribute.

public static assertClassHasAttribute(string $attributeName, string $className[, string $message = '' ]) : mixed
Parameters
$attributeName : string
$className : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertClassHasStaticAttribute()

Asserts that a class has a specified static attribute.

public static assertClassHasStaticAttribute(string $attributeName, string $className[, string $message = '' ]) : mixed
Parameters
$attributeName : string
$className : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertClassNotHasAttribute()

Asserts that a class does not have a specified attribute.

public static assertClassNotHasAttribute(string $attributeName, string $className[, string $message = '' ]) : mixed
Parameters
$attributeName : string
$className : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertClassNotHasStaticAttribute()

Asserts that a class does not have a specified static attribute.

public static assertClassNotHasStaticAttribute(string $attributeName, string $className[, string $message = '' ]) : mixed
Parameters
$attributeName : string
$className : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertContains()

Asserts that a haystack contains a needle.

public static assertContains(mixed $needle, mixed $haystack[, string $message = '' ][, bool $ignoreCase = false ][, bool $checkForObjectIdentity = true ][, bool $checkForNonObjectIdentity = false ]) : mixed
Parameters
$needle : mixed
$haystack : mixed
$message : string = ''
$ignoreCase : bool = false
$checkForObjectIdentity : bool = true
$checkForNonObjectIdentity : bool = false
Tags
since

Method available since Release 2.1.0

Return values
mixed

assertContainsOnly()

Asserts that a haystack contains only values of a given type.

public static assertContainsOnly(string $type, mixed $haystack[, bool $isNativeType = null ][, string $message = '' ]) : mixed
Parameters
$type : string
$haystack : mixed
$isNativeType : bool = null
$message : string = ''
Tags
since

Method available since Release 3.1.4

Return values
mixed

assertContainsOnlyInstancesOf()

Asserts that a haystack contains only instances of a given classname

public static assertContainsOnlyInstancesOf(string $classname, array<string|int, mixed>|Traversable $haystack[, string $message = '' ]) : mixed
Parameters
$classname : string
$haystack : array<string|int, mixed>|Traversable
$message : string = ''
Return values
mixed

assertCount()

Asserts the number of elements of an array, Countable or Traversable.

public static assertCount(int $expectedCount, mixed $haystack[, string $message = '' ]) : mixed
Parameters
$expectedCount : int
$haystack : mixed
$message : string = ''
Return values
mixed

assertEmpty()

Asserts that a variable is empty.

public static assertEmpty(mixed $actual[, string $message = '' ]) : mixed
Parameters
$actual : mixed
$message : string = ''
Tags
throws
PHPUnit_Framework_AssertionFailedError
Return values
mixed

assertEquals()

Asserts that two variables are equal.

public static assertEquals(mixed $expected, mixed $actual[, string $message = '' ][, float $delta = 0.0 ][, int $maxDepth = 10 ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
$delta : float = 0.0
$maxDepth : int = 10
$canonicalize : bool = false
$ignoreCase : bool = false
Return values
mixed

assertEqualXMLStructure()

Asserts that a hierarchy of DOMElements matches.

public static assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement[, bool $checkAttributes = false ][, string $message = '' ]) : mixed
Parameters
$expectedElement : DOMElement
$actualElement : DOMElement
$checkAttributes : bool = false
$message : string = ''
Tags
since

Method available since Release 3.3.0

Return values
mixed

assertFalse()

Asserts that a condition is false.

public static assertFalse(bool $condition[, string $message = '' ]) : mixed
Parameters
$condition : bool
$message : string = ''
Tags
throws
PHPUnit_Framework_AssertionFailedError
Return values
mixed

assertFileEquals()

Asserts that the contents of one file is equal to the contents of another file.

public static assertFileEquals(string $expected, string $actual[, string $message = '' ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expected : string
$actual : string
$message : string = ''
$canonicalize : bool = false
$ignoreCase : bool = false
Tags
since

Method available since Release 3.2.14

Return values
mixed

assertFileExists()

Asserts that a file exists.

public static assertFileExists(string $filename[, string $message = '' ]) : mixed
Parameters
$filename : string
$message : string = ''
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertFileNotEquals()

Asserts that the contents of one file is not equal to the contents of another file.

public static assertFileNotEquals(string $expected, string $actual[, string $message = '' ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expected : string
$actual : string
$message : string = ''
$canonicalize : bool = false
$ignoreCase : bool = false
Tags
since

Method available since Release 3.2.14

Return values
mixed

assertFileNotExists()

Asserts that a file does not exist.

public static assertFileNotExists(string $filename[, string $message = '' ]) : mixed
Parameters
$filename : string
$message : string = ''
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertGreaterThan()

Asserts that a value is greater than another value.

public static assertGreaterThan(mixed $expected, mixed $actual[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertGreaterThanOrEqual()

Asserts that a value is greater than or equal to another value.

public static assertGreaterThanOrEqual(mixed $expected, mixed $actual[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertInstanceOf()

Asserts that a variable is of a given type.

public static assertInstanceOf(string $expected, mixed $actual[, string $message = '' ]) : mixed
Parameters
$expected : string
$actual : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertInternalType()

Asserts that a variable is of a given type.

public static assertInternalType(string $expected, mixed $actual[, string $message = '' ]) : mixed
Parameters
$expected : string
$actual : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertJson()

Asserts that a string is a valid JSON string.

public static assertJson(string $actualJson[, string $message = '' ]) : mixed
Parameters
$actualJson : string
$message : string = ''
Tags
since

Method available since Release 3.7.20

Return values
mixed

assertJsonFileEqualsJsonFile()

Asserts that two JSON files are equal.

public static assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile[, string $message = '' ]) : mixed
Parameters
$expectedFile : string
$actualFile : string
$message : string = ''
Return values
mixed

assertJsonFileNotEqualsJsonFile()

Asserts that two JSON files are not equal.

public static assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile[, string $message = '' ]) : mixed
Parameters
$expectedFile : string
$actualFile : string
$message : string = ''
Return values
mixed

assertJsonStringEqualsJsonFile()

Asserts that the generated JSON encoded object and the content of the given file are equal.

public static assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson[, string $message = '' ]) : mixed
Parameters
$expectedFile : string
$actualJson : string
$message : string = ''
Return values
mixed

assertJsonStringEqualsJsonString()

Asserts that two given JSON encoded objects or arrays are equal.

public static assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson[, string $message = '' ]) : mixed
Parameters
$expectedJson : string
$actualJson : string
$message : string = ''
Return values
mixed

assertJsonStringNotEqualsJsonFile()

Asserts that the generated JSON encoded object and the content of the given file are not equal.

public static assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson[, string $message = '' ]) : mixed
Parameters
$expectedFile : string
$actualJson : string
$message : string = ''
Return values
mixed

assertJsonStringNotEqualsJsonString()

Asserts that two given JSON encoded objects or arrays are not equal.

public static assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson[, string $message = '' ]) : mixed
Parameters
$expectedJson : string
$actualJson : string
$message : string = ''
Return values
mixed

assertLessThan()

Asserts that a value is smaller than another value.

public static assertLessThan(mixed $expected, mixed $actual[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertLessThanOrEqual()

Asserts that a value is smaller than or equal to another value.

public static assertLessThanOrEqual(mixed $expected, mixed $actual[, string $message = '' ]) : mixed
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertNotContains()

Asserts that a haystack does not contain a needle.

public static assertNotContains(mixed $needle, mixed $haystack[, string $message = '' ][, bool $ignoreCase = false ][, bool $checkForObjectIdentity = true ][, bool $checkForNonObjectIdentity = false ]) : mixed
Parameters
$needle : mixed
$haystack : mixed
$message : string = ''
$ignoreCase : bool = false
$checkForObjectIdentity : bool = true
$checkForNonObjectIdentity : bool = false
Tags
since

Method available since Release 2.1.0

Return values
mixed

assertNotContainsOnly()

Asserts that a haystack does not contain only values of a given type.

public static assertNotContainsOnly(string $type, mixed $haystack[, bool $isNativeType = null ][, string $message = '' ]) : mixed
Parameters
$type : string
$haystack : mixed
$isNativeType : bool = null
$message : string = ''
Tags
since

Method available since Release 3.1.4

Return values
mixed

assertNotCount()

Asserts the number of elements of an array, Countable or Traversable.

public static assertNotCount(int $expectedCount, mixed $haystack[, string $message = '' ]) : mixed
Parameters
$expectedCount : int
$haystack : mixed
$message : string = ''
Return values
mixed

assertNotEmpty()

Asserts that a variable is not empty.

public static assertNotEmpty(mixed $actual[, string $message = '' ]) : mixed
Parameters
$actual : mixed
$message : string = ''
Tags
throws
PHPUnit_Framework_AssertionFailedError
Return values
mixed

assertNotEquals()

Asserts that two variables are not equal.

public static assertNotEquals(mixed $expected, mixed $actual[, string $message = '' ][, float $delta = 0.0 ][, int $maxDepth = 10 ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expected : mixed
$actual : mixed
$message : string = ''
$delta : float = 0.0
$maxDepth : int = 10
$canonicalize : bool = false
$ignoreCase : bool = false
Tags
since

Method available since Release 2.3.0

Return values
mixed

assertNotFalse()

Asserts that a condition is not false.

public static assertNotFalse(bool $condition[, string $message = '' ]) : mixed
Parameters
$condition : bool
$message : string = ''
Tags
throws
PHPUnit_Framework_AssertionFailedError
Return values
mixed

assertNotInstanceOf()

Asserts that a variable is not of a given type.

public static assertNotInstanceOf(string $expected, mixed $actual[, string $message = '' ]) : mixed
Parameters
$expected : string
$actual : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertNotInternalType()

Asserts that a variable is not of a given type.

public static assertNotInternalType(string $expected, mixed $actual[, string $message = '' ]) : mixed
Parameters
$expected : string
$actual : mixed
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertNotNull()

Asserts that a variable is not null.

public static assertNotNull(mixed $actual[, string $message = '' ]) : mixed
Parameters
$actual : mixed
$message : string = ''
Return values
mixed

assertNotRegExp()

Asserts that a string does not match a given regular expression.

public static assertNotRegExp(string $pattern, string $string[, string $message = '' ]) : mixed
Parameters
$pattern : string
$string : string
$message : string = ''
Tags
since

Method available since Release 2.1.0

Return values
mixed

assertNotSame()

Asserts that two variables do not have the same type and value.

public static assertNotSame(mixed $expected, mixed $actual[, string $message = '' ]) : mixed

Used on objects, it asserts that two variables do not reference the same object.

Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Return values
mixed

assertNotSameSize()

Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same.

public static assertNotSameSize(array<string|int, mixed>|Countable|Traversable $expected, array<string|int, mixed>|Countable|Traversable $actual[, string $message = '' ]) : mixed
Parameters
$expected : array<string|int, mixed>|Countable|Traversable
$actual : array<string|int, mixed>|Countable|Traversable
$message : string = ''
Return values
mixed

assertNotTag()

This assertion is the exact opposite of assertTag().

public static assertNotTag(array<string|int, mixed> $matcher, string $actual[, string $message = '' ][, bool $isHtml = true ]) : mixed

Rather than asserting that $matcher results in a match, it asserts that $matcher does not match.

Parameters
$matcher : array<string|int, mixed>
$actual : string
$message : string = ''
$isHtml : bool = true
Tags
since

Method available since Release 3.3.0

deprecated
codeCoverageIgnore
Return values
mixed

assertNotTrue()

Asserts that a condition is not true.

public static assertNotTrue(bool $condition[, string $message = '' ]) : mixed
Parameters
$condition : bool
$message : string = ''
Tags
throws
PHPUnit_Framework_AssertionFailedError
Return values
mixed

assertNull()

Asserts that a variable is null.

public static assertNull(mixed $actual[, string $message = '' ]) : mixed
Parameters
$actual : mixed
$message : string = ''
Return values
mixed

assertObjectHasAttribute()

Asserts that an object has a specified attribute.

public static assertObjectHasAttribute(string $attributeName, object $object[, string $message = '' ]) : mixed
Parameters
$attributeName : string
$object : object
$message : string = ''
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertObjectNotHasAttribute()

Asserts that an object does not have a specified attribute.

public static assertObjectNotHasAttribute(string $attributeName, object $object[, string $message = '' ]) : mixed
Parameters
$attributeName : string
$object : object
$message : string = ''
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertRegExp()

Asserts that a string matches a given regular expression.

public static assertRegExp(string $pattern, string $string[, string $message = '' ]) : mixed
Parameters
$pattern : string
$string : string
$message : string = ''
Return values
mixed

assertSame()

Asserts that two variables have the same type and value.

public static assertSame(mixed $expected, mixed $actual[, string $message = '' ]) : mixed

Used on objects, it asserts that two variables reference the same object.

Parameters
$expected : mixed
$actual : mixed
$message : string = ''
Return values
mixed

assertSameSize()

Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same.

public static assertSameSize(array<string|int, mixed>|Countable|Traversable $expected, array<string|int, mixed>|Countable|Traversable $actual[, string $message = '' ]) : mixed
Parameters
$expected : array<string|int, mixed>|Countable|Traversable
$actual : array<string|int, mixed>|Countable|Traversable
$message : string = ''
Return values
mixed

assertSelectCount()

Assert the presence, absence, or count of elements in a document matching the CSS $selector, regardless of the contents of those elements.

public static assertSelectCount(array<string|int, mixed> $selector, int|bool|array<string|int, mixed> $count, mixed $actual[, string $message = '' ][, bool $isHtml = true ]) : mixed

The first argument, $selector, is the CSS selector used to match the elements in the $actual document.

The second argument, $count, can be either boolean or numeric. When boolean, it asserts for presence of elements matching the selector (true) or absence of elements (false). When numeric, it asserts the count of elements.

assertSelectCount("#binder", true, $xml); // any? assertSelectCount(".binder", 3, $xml); // exactly 3?

Parameters
$selector : array<string|int, mixed>
$count : int|bool|array<string|int, mixed>
$actual : mixed
$message : string = ''
$isHtml : bool = true
Tags
since

Method available since Release 3.3.0

deprecated
codeCoverageIgnore
Return values
mixed

assertSelectEquals()

assertSelectEquals("#binder .name", "Chuck", true, $xml); // any? assertSelectEquals("#binder .name", "Chuck", false, $xml); // none?

public static assertSelectEquals(array<string|int, mixed> $selector, string $content, int|bool|array<string|int, mixed> $count, mixed $actual[, string $message = '' ][, bool $isHtml = true ]) : mixed
Parameters
$selector : array<string|int, mixed>
$content : string
$count : int|bool|array<string|int, mixed>
$actual : mixed
$message : string = ''
$isHtml : bool = true
Tags
since

Method available since Release 3.3.0

deprecated
codeCoverageIgnore
Return values
mixed

assertSelectRegExp()

assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any? assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml); // 3?

public static assertSelectRegExp(array<string|int, mixed> $selector, string $pattern, int|bool|array<string|int, mixed> $count, mixed $actual[, string $message = '' ][, bool $isHtml = true ]) : mixed
Parameters
$selector : array<string|int, mixed>
$pattern : string
$count : int|bool|array<string|int, mixed>
$actual : mixed
$message : string = ''
$isHtml : bool = true
Tags
since

Method available since Release 3.3.0

deprecated
codeCoverageIgnore
Return values
mixed

assertStringEndsNotWith()

Asserts that a string ends not with a given suffix.

public static assertStringEndsNotWith(string $suffix, string $string[, string $message = '' ]) : mixed
Parameters
$suffix : string
$string : string
$message : string = ''
Tags
since

Method available since Release 3.4.0

Return values
mixed

assertStringEndsWith()

Asserts that a string ends with a given suffix.

public static assertStringEndsWith(string $suffix, string $string[, string $message = '' ]) : mixed
Parameters
$suffix : string
$string : string
$message : string = ''
Tags
since

Method available since Release 3.4.0

Return values
mixed

assertStringEqualsFile()

Asserts that the contents of a string is equal to the contents of a file.

public static assertStringEqualsFile(string $expectedFile, string $actualString[, string $message = '' ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expectedFile : string
$actualString : string
$message : string = ''
$canonicalize : bool = false
$ignoreCase : bool = false
Tags
since

Method available since Release 3.3.0

Return values
mixed

assertStringMatchesFormat()

Asserts that a string matches a given format string.

public static assertStringMatchesFormat(string $format, string $string[, string $message = '' ]) : mixed
Parameters
$format : string
$string : string
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertStringMatchesFormatFile()

Asserts that a string matches a given format file.

public static assertStringMatchesFormatFile(string $formatFile, string $string[, string $message = '' ]) : mixed
Parameters
$formatFile : string
$string : string
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertStringNotEqualsFile()

Asserts that the contents of a string is not equal to the contents of a file.

public static assertStringNotEqualsFile(string $expectedFile, string $actualString[, string $message = '' ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expectedFile : string
$actualString : string
$message : string = ''
$canonicalize : bool = false
$ignoreCase : bool = false
Tags
since

Method available since Release 3.3.0

Return values
mixed

assertStringNotMatchesFormat()

Asserts that a string does not match a given format string.

public static assertStringNotMatchesFormat(string $format, string $string[, string $message = '' ]) : mixed
Parameters
$format : string
$string : string
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertStringNotMatchesFormatFile()

Asserts that a string does not match a given format string.

public static assertStringNotMatchesFormatFile(string $formatFile, string $string[, string $message = '' ]) : mixed
Parameters
$formatFile : string
$string : string
$message : string = ''
Tags
since

Method available since Release 3.5.0

Return values
mixed

assertStringStartsNotWith()

Asserts that a string starts not with a given prefix.

public static assertStringStartsNotWith(string $prefix, string $string[, string $message = '' ]) : mixed
Parameters
$prefix : string
$string : string
$message : string = ''
Tags
since

Method available since Release 3.4.0

Return values
mixed

assertStringStartsWith()

Asserts that a string starts with a given prefix.

public static assertStringStartsWith(string $prefix, string $string[, string $message = '' ]) : mixed
Parameters
$prefix : string
$string : string
$message : string = ''
Tags
since

Method available since Release 3.4.0

Return values
mixed

assertTag()

Evaluate an HTML or XML string and assert its structure and/or contents.

public static assertTag(array<string|int, mixed> $matcher, string $actual[, string $message = '' ][, bool $isHtml = true ]) : mixed

The first argument ($matcher) is an associative array that specifies the match criteria for the assertion:

  • id : the node with the given id attribute must match the corresponding value.
  • tag : the node type must match the corresponding value.
  • attributes : a hash. The node's attributes must match the corresponding values in the hash.
  • content : The text content must match the given value.
  • parent : a hash. The node's parent must match the corresponding hash.
  • child : a hash. At least one of the node's immediate children must meet the criteria described by the hash.
  • ancestor : a hash. At least one of the node's ancestors must meet the criteria described by the hash.
  • descendant : a hash. At least one of the node's descendants must meet the criteria described by the hash.
  • children : a hash, for counting children of a node. Accepts the keys:
    • count : a number which must equal the number of children that match
    • less_than : the number of matching children must be greater than this number
    • greater_than : the number of matching children must be less than this number
    • only : another hash consisting of the keys to use to match on the children, and only matching children will be counted
// Matcher that asserts that there is an element with an id="my_id". $matcher = array('id' => 'my_id');

// Matcher that asserts that there is a "span" tag. $matcher = array('tag' => 'span');

// Matcher that asserts that there is a "span" tag with the content // "Hello World". $matcher = array('tag' => 'span', 'content' => 'Hello World');

// Matcher that asserts that there is a "span" tag with content matching // the regular expression pattern. $matcher = array('tag' => 'span', 'content' => 'regexp:/Try P(HP|ython)/');

// Matcher that asserts that there is a "span" with an "list" class // attribute. $matcher = array( 'tag' => 'span', 'attributes' => array('class' => 'list') );

// Matcher that asserts that there is a "span" inside of a "div". $matcher = array( 'tag' => 'span', 'parent' => array('tag' => 'div') );

// Matcher that asserts that there is a "span" somewhere inside a // "table". $matcher = array( 'tag' => 'span', 'ancestor' => array('tag' => 'table') );

// Matcher that asserts that there is a "span" with at least one "em" // child. $matcher = array( 'tag' => 'span', 'child' => array('tag' => 'em') );

// Matcher that asserts that there is a "span" containing a (possibly // nested) "strong" tag. $matcher = array( 'tag' => 'span', 'descendant' => array('tag' => 'strong') );

// Matcher that asserts that there is a "span" containing 5-10 "em" tags // as immediate children. $matcher = array( 'tag' => 'span', 'children' => array( 'less_than' => 11, 'greater_than' => 4, 'only' => array('tag' => 'em') ) );

// Matcher that asserts that there is a "div", with an "ul" ancestor and // a "li" parent (with class="enum"), and containing a "span" descendant // that contains an element with id="my_test" and the text "Hello World". $matcher = array( 'tag' => 'div', 'ancestor' => array('tag' => 'ul'), 'parent' => array( 'tag' => 'li', 'attributes' => array('class' => 'enum') ), 'descendant' => array( 'tag' => 'span', 'child' => array( 'id' => 'my_test', 'content' => 'Hello World' ) ) );

// Use assertTag() to apply a $matcher to a piece of $html. $this->assertTag($matcher, $html);

// Use assertTag() to apply a $matcher to a piece of $xml. $this->assertTag($matcher, $xml, '', false);

The second argument ($actual) is a string containing either HTML or XML text to be tested.

The third argument ($message) is an optional message that will be used if the assertion fails.

The fourth argument ($html) is an optional flag specifying whether to load the $actual string into a DOMDocument using the HTML or XML load strategy. It is true by default, which assumes the HTML load strategy. In many cases, this will be acceptable for XML as well.

Parameters
$matcher : array<string|int, mixed>
$actual : string
$message : string = ''
$isHtml : bool = true
Tags
since

Method available since Release 3.3.0

deprecated
codeCoverageIgnore
Return values
mixed

assertThat()

Evaluates a PHPUnit_Framework_Constraint matcher object.

public static assertThat(mixed $value, PHPUnit_Framework_Constraint $constraint[, string $message = '' ]) : mixed
Parameters
$value : mixed
$constraint : PHPUnit_Framework_Constraint
$message : string = ''
Tags
since

Method available since Release 3.0.0

Return values
mixed

assertTrue()

Asserts that a condition is true.

public static assertTrue(bool $condition[, string $message = '' ]) : mixed
Parameters
$condition : bool
$message : string = ''
Tags
throws
PHPUnit_Framework_AssertionFailedError
Return values
mixed

assertXmlFileEqualsXmlFile()

Asserts that two XML files are equal.

public static assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile[, string $message = '' ]) : mixed
Parameters
$expectedFile : string
$actualFile : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertXmlFileNotEqualsXmlFile()

Asserts that two XML files are not equal.

public static assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile[, string $message = '' ]) : mixed
Parameters
$expectedFile : string
$actualFile : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertXmlStringEqualsXmlFile()

Asserts that two XML documents are equal.

public static assertXmlStringEqualsXmlFile(string $expectedFile, string $actualXml[, string $message = '' ]) : mixed
Parameters
$expectedFile : string
$actualXml : string
$message : string = ''
Tags
since

Method available since Release 3.3.0

Return values
mixed

assertXmlStringEqualsXmlString()

Asserts that two XML documents are equal.

public static assertXmlStringEqualsXmlString(string $expectedXml, string $actualXml[, string $message = '' ]) : mixed
Parameters
$expectedXml : string
$actualXml : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

assertXmlStringNotEqualsXmlFile()

Asserts that two XML documents are not equal.

public static assertXmlStringNotEqualsXmlFile(string $expectedFile, string $actualXml[, string $message = '' ]) : mixed
Parameters
$expectedFile : string
$actualXml : string
$message : string = ''
Tags
since

Method available since Release 3.3.0

Return values
mixed

assertXmlStringNotEqualsXmlString()

Asserts that two XML documents are not equal.

public static assertXmlStringNotEqualsXmlString(string $expectedXml, string $actualXml[, string $message = '' ]) : mixed
Parameters
$expectedXml : string
$actualXml : string
$message : string = ''
Tags
since

Method available since Release 3.1.0

Return values
mixed

attributeEqualTo()

Returns a PHPUnit_Framework_Constraint_IsEqual matcher object that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher object.

public static attributeEqualTo(string $attributeName, mixed $value[, float $delta = 0.0 ][, int $maxDepth = 10 ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : PHPUnit_Framework_Constraint_Attribute
Parameters
$attributeName : string
$value : mixed
$delta : float = 0.0
$maxDepth : int = 10
$canonicalize : bool = false
$ignoreCase : bool = false
Tags
since

Method available since Release 3.1.0

Return values
PHPUnit_Framework_Constraint_Attribute

contains()

Returns a PHPUnit_Framework_Constraint_TraversableContains matcher object.

public static contains(mixed $value[, bool $checkForObjectIdentity = true ][, bool $checkForNonObjectIdentity = false ]) : PHPUnit_Framework_Constraint_TraversableContains
Parameters
$value : mixed
$checkForObjectIdentity : bool = true
$checkForNonObjectIdentity : bool = false
Tags
since

Method available since Release 3.0.0

Return values
PHPUnit_Framework_Constraint_TraversableContains

count()

Counts the number of test cases executed by run(TestResult result).

public count() : int
Return values
int

equalTo()

Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.

public static equalTo(mixed $value[, float $delta = 0.0 ][, int $maxDepth = 10 ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : PHPUnit_Framework_Constraint_IsEqual
Parameters
$value : mixed
$delta : float = 0.0
$maxDepth : int = 10
$canonicalize : bool = false
$ignoreCase : bool = false
Tags
since

Method available since Release 3.0.0

Return values
PHPUnit_Framework_Constraint_IsEqual

expectOutputRegex()

public expectOutputRegex(string $expectedRegex) : mixed
Parameters
$expectedRegex : string
Tags
since

Method available since Release 3.6.0

throws
PHPUnit_Framework_Exception
Return values
mixed

expectOutputString()

public expectOutputString(string $expectedString) : mixed
Parameters
$expectedString : string
Tags
since

Method available since Release 3.6.0

Return values
mixed

getActualOutput()

public getActualOutput() : string
Tags
since

Method available since Release 3.6.0

Return values
string

getAnnotations()

Returns the annotations for this test.

public getAnnotations() : array<string|int, mixed>
Tags
since

Method available since Release 3.4.0

Return values
array<string|int, mixed>

getCount()

Return the current assertion count.

public static getCount() : int
Tags
since

Method available since Release 3.3.3

Return values
int

getExpectedException()

public getExpectedException() : string
Tags
since

Method available since Release 3.2.0

Return values
string

getMock()

Returns a mock object for the specified class.

public getMock(string $originalClassName[, array<string|int, mixed>|null $methods = array() ][, array<string|int, mixed> $arguments = array() ][, string $mockClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, bool $cloneArguments = false ][, bool $callOriginalMethods = false ][, object $proxyTarget = null ]) : PHPUnit_Framework_MockObject_MockObject
Parameters
$originalClassName : string

Name of the class to mock.

$methods : array<string|int, mixed>|null = array()

When provided, only methods whose names are in the array are replaced with a configurable test double. The behavior of the other methods is not changed. Providing null means that no methods will be replaced.

$arguments : array<string|int, mixed> = array()

Parameters to pass to the original class' constructor.

$mockClassName : string = ''

Class name for the generated test double class.

$callOriginalConstructor : bool = true

Can be used to disable the call to the original class' constructor.

$callOriginalClone : bool = true

Can be used to disable the call to the original class' clone constructor.

$callAutoload : bool = true

Can be used to disable __autoload() during the generation of the test double class.

$cloneArguments : bool = false
$callOriginalMethods : bool = false
$proxyTarget : object = null
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.0.0

Return values
PHPUnit_Framework_MockObject_MockObject

getMockForAbstractClass()

Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default.

public getMockForAbstractClass(string $originalClassName[, array<string|int, mixed> $arguments = array() ][, string $mockClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, array<string|int, mixed> $mockedMethods = array() ][, bool $cloneArguments = false ]) : PHPUnit_Framework_MockObject_MockObject

To mock concrete methods, use the 7th parameter ($mockedMethods).

Parameters
$originalClassName : string
$arguments : array<string|int, mixed> = array()
$mockClassName : string = ''
$callOriginalConstructor : bool = true
$callOriginalClone : bool = true
$callAutoload : bool = true
$mockedMethods : array<string|int, mixed> = array()
$cloneArguments : bool = false
Tags
since

Method available since Release 3.4.0

throws
PHPUnit_Framework_Exception
Return values
PHPUnit_Framework_MockObject_MockObject

getMockForTrait()

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.

public getMockForTrait(string $traitName[, array<string|int, mixed> $arguments = array() ][, string $mockClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, array<string|int, mixed> $mockedMethods = array() ][, bool $cloneArguments = false ]) : PHPUnit_Framework_MockObject_MockObject
Parameters
$traitName : string
$arguments : array<string|int, mixed> = array()
$mockClassName : string = ''
$callOriginalConstructor : bool = true
$callOriginalClone : bool = true
$callAutoload : bool = true
$mockedMethods : array<string|int, mixed> = array()
$cloneArguments : bool = false
Tags
since

Method available since Release 4.0.0

throws
PHPUnit_Framework_Exception
Return values
PHPUnit_Framework_MockObject_MockObject

getName()

Gets the name of a TestCase.

public getName([bool $withDataSet = true ]) : string
Parameters
$withDataSet : bool = true
Return values
string

getNumAssertions()

Returns the number of assertions performed by this test.

public getNumAssertions() : int
Tags
since

Method available since Release 3.3.0

Return values
int

getObjectAttribute()

Returns the value of an object's attribute.

public static getObjectAttribute(object $object, string $attributeName) : mixed

This also works for attributes that are declared protected or private.

Parameters
$object : object
$attributeName : string
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 4.0.0

Return values
mixed

getResult()

public getResult() : mixed
Tags
since

Method available since Release 3.4.0

Return values
mixed

getSize()

Returns the size of the test.

public getSize() : int
Tags
since

Method available since Release 3.6.0

Return values
int

getStaticAttribute()

Returns the value of a static attribute.

public static getStaticAttribute(string $className, string $attributeName) : mixed

This also works for attributes that are declared protected or private.

Parameters
$className : string
$attributeName : string
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 4.0.0

Return values
mixed

getStatus()

Returns the status of this test.

public getStatus() : int
Tags
since

Method available since Release 3.1.0

Return values
int

getStatusMessage()

Returns the status message of this test.

public getStatusMessage() : string
Tags
since

Method available since Release 3.3.0

Return values
string

greaterThanOrEqual()

Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps a PHPUnit_Framework_Constraint_IsEqual and a PHPUnit_Framework_Constraint_GreaterThan matcher object.

public static greaterThanOrEqual(mixed $value) : PHPUnit_Framework_Constraint_Or
Parameters
$value : mixed
Tags
since

Method available since Release 3.1.0

Return values
PHPUnit_Framework_Constraint_Or

hasDependencies()

Returns true if the tests has dependencies

public hasDependencies() : bool
Tags
since

Method available since Release 4.0.0

Return values
bool

hasExpectationOnOutput()

public hasExpectationOnOutput() : bool
Tags
since

Method available since Release 4.3.3

Return values
bool

hasFailed()

Returns whether or not this test has failed.

public hasFailed() : bool
Tags
since

Method available since Release 3.0.0

Return values
bool

hasOutput()

public hasOutput() : bool
Tags
since

Method available since Release 3.6.0

Return values
bool

hasPerformedExpectationsOnOutput()

public hasPerformedExpectationsOnOutput() : bool
Tags
since

Method available since Release 3.6.5

deprecated
Return values
bool

isInIsolation()

public isInIsolation() : bool
Tags
since

Method available since Release 4.3.0

Return values
bool

lessThanOrEqual()

Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps a PHPUnit_Framework_Constraint_IsEqual and a PHPUnit_Framework_Constraint_LessThan matcher object.

public static lessThanOrEqual(mixed $value) : PHPUnit_Framework_Constraint_Or
Parameters
$value : mixed
Tags
since

Method available since Release 3.1.0

Return values
PHPUnit_Framework_Constraint_Or

markTestIncomplete()

Mark the test as incomplete.

public static markTestIncomplete([string $message = '' ]) : mixed
Parameters
$message : string = ''
Tags
throws
PHPUnit_Framework_IncompleteTestError
since

Method available since Release 3.0.0

Return values
mixed

markTestSkipped()

Mark the test as skipped.

public static markTestSkipped([string $message = '' ]) : mixed
Parameters
$message : string = ''
Tags
throws
PHPUnit_Framework_SkippedTestError
since

Method available since Release 3.0.0

Return values
mixed

readAttribute()

Returns the value of an attribute of a class or an object.

public static readAttribute(mixed $classOrObject, string $attributeName) : mixed

This also works for attributes that are declared protected or private.

Parameters
$classOrObject : mixed
$attributeName : string
Tags
throws
PHPUnit_Framework_Exception
Return values
mixed

resetCount()

Reset the assertion counter.

public static resetCount() : mixed
Tags
since

Method available since Release 3.3.3

Return values
mixed

runBare()

Runs the bare test sequence.

public runBare() : mixed
Return values
mixed

setBackupGlobals()

Calling this method in setUp() has no effect!

public setBackupGlobals(bool $backupGlobals) : mixed
Parameters
$backupGlobals : bool
Tags
since

Method available since Release 3.3.0

Return values
mixed

setBackupStaticAttributes()

Calling this method in setUp() has no effect!

public setBackupStaticAttributes(bool $backupStaticAttributes) : mixed
Parameters
$backupStaticAttributes : bool
Tags
since

Method available since Release 3.4.0

Return values
mixed

setDependencies()

Sets the dependencies of a TestCase.

public setDependencies(array<string|int, mixed> $dependencies) : mixed
Parameters
$dependencies : array<string|int, mixed>
Tags
since

Method available since Release 3.4.0

Return values
mixed

setDependencyInput()

Sets

public setDependencyInput(array<string|int, mixed> $dependencyInput) : mixed
Parameters
$dependencyInput : array<string|int, mixed>
Tags
since

Method available since Release 3.4.0

Return values
mixed

setDisallowChangesToGlobalState()

public setDisallowChangesToGlobalState(bool $disallowChangesToGlobalState) : mixed
Parameters
$disallowChangesToGlobalState : bool
Tags
since

Method available since Release 4.6.0

Return values
mixed

setExpectedException()

public setExpectedException(mixed $exceptionName[, string $exceptionMessage = '' ][, int $exceptionCode = null ]) : mixed
Parameters
$exceptionName : mixed
$exceptionMessage : string = ''
$exceptionCode : int = null
Tags
since

Method available since Release 3.2.0

Return values
mixed

setExpectedExceptionRegExp()

public setExpectedExceptionRegExp(mixed $exceptionName[, string $exceptionMessageRegExp = '' ][, int $exceptionCode = null ]) : mixed
Parameters
$exceptionName : mixed
$exceptionMessageRegExp : string = ''
$exceptionCode : int = null
Tags
since

Method available since Release 4.3.0

Return values
mixed

setInIsolation()

public setInIsolation(bool $inIsolation) : mixed
Parameters
$inIsolation : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.4.0

Return values
mixed

setName()

Sets the name of a TestCase.

public setName(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

setOutputCallback()

public setOutputCallback(callable $callback) : mixed
Parameters
$callback : callable
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.6.0

Return values
mixed

setPreserveGlobalState()

public setPreserveGlobalState(bool $preserveGlobalState) : mixed
Parameters
$preserveGlobalState : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.4.0

Return values
mixed

setResult()

public setResult(mixed $result) : mixed
Parameters
$result : mixed
Tags
since

Method available since Release 3.4.0

Return values
mixed

setRunTestInSeparateProcess()

public setRunTestInSeparateProcess(bool $runTestInSeparateProcess) : mixed
Parameters
$runTestInSeparateProcess : bool
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.4.0

Return values
mixed

setUpBeforeClass()

This method is called before the first test of this test class is run.

public static setUpBeforeClass() : mixed
Tags
since

Method available since Release 3.4.0

Return values
mixed

setUseErrorHandler()

public setUseErrorHandler(bool $useErrorHandler) : mixed
Parameters
$useErrorHandler : bool
Tags
since

Method available since Release 3.4.0

Return values
mixed

tearDownAfterClass()

This method is called after the last test of this test class is run.

public static tearDownAfterClass() : mixed
Tags
since

Method available since Release 3.4.0

Return values
mixed

testGetEndLineWithScopedNamespace()

public testGetEndLineWithScopedNamespace() : mixed
Return values
mixed

testGetEndLineWithUnscopedNamespace()

public testGetEndLineWithUnscopedNamespace() : mixed
Return values
mixed

testGetName()

public testGetName() : mixed
Tags
covers
Return values
mixed

testGetStartLineWithScopedNamespace()

public testGetStartLineWithScopedNamespace() : mixed
Return values
mixed

testGetStartLineWithUnscopedNamespace()

public testGetStartLineWithUnscopedNamespace() : mixed
Return values
mixed

toString()

Returns a string representation of the test case.

public toString() : string
Return values
string

assertPostConditions()

Performs assertions shared by all tests of a test case.

protected assertPostConditions() : mixed

This method is called before the execution of a test ends and before tearDown() is called.

Tags
since

Method available since Release 3.2.8

Return values
mixed

assertPreConditions()

Performs assertions shared by all tests of a test case.

protected assertPreConditions() : mixed

This method is called before the execution of a test starts and after setUp() is called.

Tags
since

Method available since Release 3.2.8

Return values
mixed

checkRequirements()

protected checkRequirements() : mixed
Tags
since

Method available since Release 3.6.0

Return values
mixed

getDataSetAsString()

Gets the data set description of a TestCase.

protected getDataSetAsString([bool $includeData = true ]) : string
Parameters
$includeData : bool = true
Tags
since

Method available since Release 3.3.0

Return values
string

getMockClass()

Mocks the specified class and returns the name of the mocked class.

protected getMockClass(string $originalClassName[, array<string|int, mixed> $methods = array() ][, array<string|int, mixed> $arguments = array() ][, string $mockClassName = '' ][, bool $callOriginalConstructor = false ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, bool $cloneArguments = false ]) : string
Parameters
$originalClassName : string
$methods : array<string|int, mixed> = array()
$arguments : array<string|int, mixed> = array()
$mockClassName : string = ''
$callOriginalConstructor : bool = false
$callOriginalClone : bool = true
$callAutoload : bool = true
$cloneArguments : bool = false
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.5.0

Return values
string

getMockFromWsdl()

Returns a mock object based on the given WSDL file.

protected getMockFromWsdl(string $wsdlFile[, string $originalClassName = '' ][, string $mockClassName = '' ][, array<string|int, mixed> $methods = array() ][, bool $callOriginalConstructor = true ][, array<string|int, mixed> $options = array() ]) : PHPUnit_Framework_MockObject_MockObject
Parameters
$wsdlFile : string
$originalClassName : string = ''
$mockClassName : string = ''
$methods : array<string|int, mixed> = array()
$callOriginalConstructor : bool = true
$options : array<string|int, mixed> = array()

An array of options passed to SOAPClient::_construct

Tags
since

Method available since Release 3.4.0

Return values
PHPUnit_Framework_MockObject_MockObject

getObjectForTrait()

Returns an object for the specified trait.

protected getObjectForTrait(string $traitName[, array<string|int, mixed> $arguments = array() ][, string $traitClassName = '' ][, bool $callOriginalConstructor = true ][, bool $callOriginalClone = true ][, bool $callAutoload = true ][, bool $cloneArguments = false ]) : object
Parameters
$traitName : string
$arguments : array<string|int, mixed> = array()
$traitClassName : string = ''
$callOriginalConstructor : bool = true
$callOriginalClone : bool = true
$callAutoload : bool = true
$cloneArguments : bool = false
Tags
since

Method available since Release 3.6.0

throws
PHPUnit_Framework_Exception
Return values
object

handleDependencies()

protected handleDependencies() : mixed
Tags
since

Method available since Release 3.5.4

Return values
mixed

iniSet()

This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run.

protected iniSet(string $varName, string $newValue) : mixed
Parameters
$varName : string
$newValue : string
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.0.0

Return values
mixed

onNotSuccessfulTest()

This method is called when a test method did not execute successfully.

protected onNotSuccessfulTest(Exception $e) : mixed
Parameters
$e : Exception
Tags
since

Method available since Release 3.4.0

throws
Exception
Return values
mixed

prepareTemplate()

Performs custom preparations on the process isolation template.

protected prepareTemplate(Text_Template $template) : mixed
Parameters
$template : Text_Template
Tags
since

Method available since Release 3.4.0

Return values
mixed

prophesize()

protected prophesize([string|null $classOrInterface = null ]) : ObjectProphecy
Parameters
$classOrInterface : string|null = null
Tags
throws
LogicException
since

Method available since Release 4.5.0

Return values
ObjectProphecy

setExpectedExceptionFromAnnotation()

protected setExpectedExceptionFromAnnotation() : mixed
Tags
since

Method available since Release 3.4.0

Return values
mixed

setLocale()

This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.

protected setLocale() : mixed
Tags
throws
PHPUnit_Framework_Exception
since

Method available since Release 3.1.0

Return values
mixed

setUp()

Sets up the fixture, for example, open a network connection.

protected setUp() : mixed

This method is called before a test is executed.

Return values
mixed

setUseErrorHandlerFromAnnotation()

protected setUseErrorHandlerFromAnnotation() : mixed
Tags
since

Method available since Release 3.4.0

Return values
mixed

tearDown()

Tears down the fixture, for example, close a network connection.

protected tearDown() : mixed

This method is called after a test is executed.

Return values
mixed

verifyMockObjects()

Verifies the mock object expectations.

protected verifyMockObjects() : mixed
Tags
since

Method available since Release 3.5.0

Return values
mixed

compareGlobalStateSnapshotPart()

private compareGlobalStateSnapshotPart(array<string|int, mixed> $before, array<string|int, mixed> $after, string $header) : mixed
Parameters
$before : array<string|int, mixed>
$after : array<string|int, mixed>
$header : string
Tags
throws
PHPUnit_Framework_RiskyTestError
Return values
mixed

compareGlobalStateSnapshots()

private compareGlobalStateSnapshots(Snapshot $before, Snapshot $after) : mixed
Parameters
$before : Snapshot
$after : Snapshot
Tags
throws
PHPUnit_Framework_RiskyTestError
Return values
mixed

createGlobalStateSnapshot()

private createGlobalStateSnapshot(bool $backupGlobals) : Snapshot
Parameters
$backupGlobals : bool
Return values
Snapshot

getProphet()

private getProphet() : Prophet
Tags
since

Method available since Release 4.5.0

Return values
Prophet

restoreGlobalState()

private restoreGlobalState() : mixed
Return values
mixed

snapshotGlobalState()

private snapshotGlobalState() : mixed
Return values
mixed

startOutputBuffering()

private startOutputBuffering() : mixed
Tags
since

Method available since Release 4.2.0

Return values
mixed

stopOutputBuffering()

private stopOutputBuffering() : mixed
Tags
since

Method available since Release 4.2.0

Return values
mixed

Search results