Documentation

Functions.php

Table of Contents

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.
assertArraySubset()  : mixed
Asserts that an array has a specified subset.
assertArrayNotHasKey()  : mixed
Asserts that an array does not have a specified key.
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.
assertEqualXMLStructure()  : mixed
Asserts that a hierarchy of DOMElements matches.
assertEquals()  : mixed
Asserts that two variables are equal.
assertNotTrue()  : mixed
Asserts that a condition is not true.
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.
assertNotInstanceOf()  : mixed
Asserts that a variable is not of a given type.
assertNotInternalType()  : mixed
Asserts that a variable is not of a given type.
assertNotFalse()  : mixed
Asserts that a condition is not false.
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().
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 prefix.
assertStringEndsWith()  : mixed
Asserts that a string ends with a given prefix.
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.
atLeastOnce()  : PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
Returns a matcher that matches when the method is executed at least once.
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.
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.
fileExists()  : PHPUnit_Framework_Constraint_FileExists
Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
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.
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.
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.
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.
onConsecutiveCalls()  : PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
once()  : PHPUnit_Framework_MockObject_Matcher_InvokedCount
Returns a matcher that matches when the method is executed exactly once.
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
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.
throwException()  : PHPUnit_Framework_MockObject_Stub_Exception

Functions

assertArrayHasKey()

Asserts that an array has a specified key.

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

assertArraySubset()

Asserts that an array has a specified subset.

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

assertArrayNotHasKey()

Asserts that an array does not have a specified key.

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

assertAttributeContains()

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

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

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.

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

assertAttributeCount()

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

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

assertAttributeEmpty()

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

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

Method available since Release 3.5.0

assertAttributeEquals()

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

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

assertAttributeGreaterThan()

Asserts that an attribute is greater than another value.

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

assertAttributeGreaterThanOrEqual()

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

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

assertAttributeInstanceOf()

Asserts that an attribute is of a given type.

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

assertAttributeInternalType()

Asserts that an attribute is of a given type.

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

assertAttributeLessThan()

Asserts that an attribute is smaller than another value.

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

assertAttributeLessThanOrEqual()

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

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

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.

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

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.

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

assertAttributeNotCount()

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

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

assertAttributeNotEmpty()

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

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

Method available since Release 3.5.0

assertAttributeNotEquals()

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

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

assertAttributeNotInstanceOf()

Asserts that an attribute is of a given type.

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

assertAttributeNotInternalType()

Asserts that an attribute is of a given type.

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

assertAttributeNotSame()

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

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

assertAttributeSame()

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

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

assertClassHasAttribute()

Asserts that a class has a specified attribute.

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

Method available since Release 3.1.0

assertClassHasStaticAttribute()

Asserts that a class has a specified static attribute.

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

Method available since Release 3.1.0

assertClassNotHasAttribute()

Asserts that a class does not have a specified attribute.

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

Method available since Release 3.1.0

assertClassNotHasStaticAttribute()

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

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

Method available since Release 3.1.0

assertContains()

Asserts that a haystack contains a needle.

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

assertContainsOnly()

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

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

assertContainsOnlyInstancesOf()

Asserts that a haystack contains only instances of a given classname

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

assertCount()

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

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

assertEqualXMLStructure()

Asserts that a hierarchy of DOMElements matches.

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

assertEquals()

Asserts that two variables are equal.

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

assertFileEquals()

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

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

assertFileExists()

Asserts that a file exists.

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

Method available since Release 3.0.0

assertFileNotEquals()

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

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

assertFileNotExists()

Asserts that a file does not exist.

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

Method available since Release 3.0.0

assertGreaterThan()

Asserts that a value is greater than another value.

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

Method available since Release 3.1.0

assertGreaterThanOrEqual()

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

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

Method available since Release 3.1.0

assertInstanceOf()

Asserts that a variable is of a given type.

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

Method available since Release 3.5.0

assertInternalType()

Asserts that a variable is of a given type.

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

Method available since Release 3.5.0

assertJson()

Asserts that a string is a valid JSON string.

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

Method available since Release 3.7.20

assertJsonFileEqualsJsonFile()

Asserts that two JSON files are equal.

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

assertJsonFileNotEqualsJsonFile()

Asserts that two JSON files are not equal.

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

assertJsonStringEqualsJsonFile()

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

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

assertJsonStringEqualsJsonString()

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

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

assertJsonStringNotEqualsJsonFile()

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

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

assertJsonStringNotEqualsJsonString()

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

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

assertLessThan()

Asserts that a value is smaller than another value.

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

Method available since Release 3.1.0

assertLessThanOrEqual()

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

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

Method available since Release 3.1.0

assertNotContains()

Asserts that a haystack does not contain a needle.

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

assertNotContainsOnly()

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

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

assertNotCount()

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

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

assertNotEquals()

Asserts that two variables are not equal.

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

assertNotInstanceOf()

Asserts that a variable is not of a given type.

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

Method available since Release 3.5.0

assertNotInternalType()

Asserts that a variable is not of a given type.

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

Method available since Release 3.5.0

assertNotNull()

Asserts that a variable is not null.

assertNotNull(mixed $actual[, string $message = '' ]) : mixed
Parameters
$actual : mixed
$message : string = ''

assertNotRegExp()

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

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

Method available since Release 2.1.0

assertNotSame()

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

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 = ''

assertNotSameSize()

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

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 = ''

assertNotTag()

This assertion is the exact opposite of assertTag().

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

assertNull()

Asserts that a variable is null.

assertNull(mixed $actual[, string $message = '' ]) : mixed
Parameters
$actual : mixed
$message : string = ''

assertObjectHasAttribute()

Asserts that an object has a specified attribute.

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

Method available since Release 3.0.0

assertObjectNotHasAttribute()

Asserts that an object does not have a specified attribute.

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

Method available since Release 3.0.0

assertRegExp()

Asserts that a string matches a given regular expression.

assertRegExp(string $pattern, string $string[, string $message = '' ]) : mixed
Parameters
$pattern : string
$string : string
$message : string = ''

assertSame()

Asserts that two variables have the same type and value.

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 = ''

assertSameSize()

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

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 = ''

assertSelectCount()

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

assertSelectCount(array<string|int, mixed> $selector, int $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
$actual : mixed
$message : string = ''
$isHtml : bool = true
Tags
since

Method available since Release 3.3.0

assertSelectEquals()

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

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

Method available since Release 3.3.0

assertSelectRegExp()

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

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

Method available since Release 3.3.0

assertStringEndsNotWith()

Asserts that a string ends not with a given prefix.

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

Method available since Release 3.4.0

assertStringEndsWith()

Asserts that a string ends with a given prefix.

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

Method available since Release 3.4.0

assertStringEqualsFile()

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

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

assertStringMatchesFormat()

Asserts that a string matches a given format string.

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

Method available since Release 3.5.0

assertStringMatchesFormatFile()

Asserts that a string matches a given format file.

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

Method available since Release 3.5.0

assertStringNotEqualsFile()

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

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

assertStringNotMatchesFormat()

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

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

Method available since Release 3.5.0

assertStringNotMatchesFormatFile()

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

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

Method available since Release 3.5.0

assertStringStartsNotWith()

Asserts that a string starts not with a given prefix.

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

Method available since Release 3.4.0

assertStringStartsWith()

Asserts that a string starts with a given prefix.

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

Method available since Release 3.4.0

assertTag()

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

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

assertXmlFileEqualsXmlFile()

Asserts that two XML files are equal.

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

Method available since Release 3.1.0

assertXmlFileNotEqualsXmlFile()

Asserts that two XML files are not equal.

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

Method available since Release 3.1.0

assertXmlStringEqualsXmlFile()

Asserts that two XML documents are equal.

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

Method available since Release 3.3.0

assertXmlStringEqualsXmlString()

Asserts that two XML documents are equal.

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

Method available since Release 3.1.0

assertXmlStringNotEqualsXmlFile()

Asserts that two XML documents are not equal.

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

Method available since Release 3.3.0

assertXmlStringNotEqualsXmlString()

Asserts that two XML documents are not equal.

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

Method available since Release 3.1.0

attributeEqualTo()

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

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

contains()

Returns a PHPUnit_Framework_Constraint_TraversableContains matcher object.

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

equalTo()

Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.

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

greaterThanOrEqual()

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

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

Method available since Release 3.1.0

lessThanOrEqual()

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

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

Method available since Release 3.1.0

matchesRegularExpression()

Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.

matchesRegularExpression(string $pattern) : PHPUnit_Framework_Constraint_PCREMatch
Parameters
$pattern : string
Tags
since

Method available since Release 3.0.0

stringContains()

Returns a PHPUnit_Framework_Constraint_StringContains matcher object.

stringContains(string $string[, bool $case = true ]) : PHPUnit_Framework_Constraint_StringContains
Parameters
$string : string
$case : bool = true
Tags
since

Method available since Release 3.0.0

Search results