class PHPUnit_Extensions_TestDecorator extends PHPUnit_Framework_Assert implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing (View source)

A Decorator for Tests.

Use TestDecorator as the base class for defining new test decorators. Test decorator subclasses can be introduced to add behaviour before or after a test is run.

Properties

protected object $test The Test to be decorated.

Methods

static 
assertArrayHasKey(mixed $key, array|ArrayAccess $array, string $message = '')

Asserts that an array has a specified key.

static 
assertArraySubset(array|ArrayAccess $subset, array|ArrayAccess $array, bool $strict = false, string $message = '')

Asserts that an array has a specified subset.

static 
assertArrayNotHasKey(mixed $key, array|ArrayAccess $array, string $message = '')

Asserts that an array does not have a specified key.

static 
assertContains(mixed $needle, mixed $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

Asserts that a haystack contains a needle.

static 
assertAttributeContains(mixed $needle, string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

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

static 
assertNotContains(mixed $needle, mixed $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

Asserts that a haystack does not contain a needle.

static 
assertAttributeNotContains(mixed $needle, string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

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.

static 
assertContainsOnly(string $type, mixed $haystack, bool $isNativeType = null, string $message = '')

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

static 
assertContainsOnlyInstancesOf(string $classname, array|Traversable $haystack, string $message = '')

Asserts that a haystack contains only instances of a given classname

static 
assertAttributeContainsOnly(string $type, string $haystackAttributeName, string|object $haystackClassOrObject, bool $isNativeType = null, string $message = '')

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.

static 
assertNotContainsOnly(string $type, mixed $haystack, bool $isNativeType = null, string $message = '')

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

static 
assertAttributeNotContainsOnly(string $type, string $haystackAttributeName, string|object $haystackClassOrObject, bool $isNativeType = null, string $message = '')

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.

static 
assertCount(int $expectedCount, mixed $haystack, string $message = '')

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

static 
assertAttributeCount(int $expectedCount, string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '')

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

static 
assertNotCount(int $expectedCount, mixed $haystack, string $message = '')

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

static 
assertAttributeNotCount(int $expectedCount, string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '')

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

static 
assertEquals(mixed $expected, mixed $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

Asserts that two variables are equal.

static 
assertAttributeEquals(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

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

static 
assertNotEquals(mixed $expected, mixed $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

Asserts that two variables are not equal.

static 
assertAttributeNotEquals(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

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

static 
assertEmpty(mixed $actual, string $message = '')

Asserts that a variable is empty.

static 
assertAttributeEmpty(string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '')

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

static 
assertNotEmpty(mixed $actual, string $message = '')

Asserts that a variable is not empty.

static 
assertAttributeNotEmpty(string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '')

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

static 
assertGreaterThan(mixed $expected, mixed $actual, string $message = '')

Asserts that a value is greater than another value.

static 
assertAttributeGreaterThan(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

Asserts that an attribute is greater than another value.

static 
assertGreaterThanOrEqual(mixed $expected, mixed $actual, string $message = '')

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

static 
assertAttributeGreaterThanOrEqual(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

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

static 
assertLessThan(mixed $expected, mixed $actual, string $message = '')

Asserts that a value is smaller than another value.

static 
assertAttributeLessThan(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

Asserts that an attribute is smaller than another value.

static 
assertLessThanOrEqual(mixed $expected, mixed $actual, string $message = '')

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

static 
assertAttributeLessThanOrEqual(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

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

static 
assertFileEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false)

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

static 
assertFileNotEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false)

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

static 
assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false)

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

static 
assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false)

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

static 
assertIsReadable(string $filename, string $message = '')

Asserts that a file/dir is readable.

static 
assertNotIsReadable(string $filename, string $message = '')

Asserts that a file/dir exists and is not readable.

static 
assertIsWritable(string $filename, string $message = '')

Asserts that a file/dir exists and is writable.

static 
assertNotIsWritable(string $filename, string $message = '')

Asserts that a file/dir exists and is not writable.

static 
assertDirectoryExists(string $directory, string $message = '')

Asserts that a directory exists.

static 
assertDirectoryNotExists(string $directory, string $message = '')

Asserts that a directory does not exist.

static 
assertDirectoryIsReadable(string $directory, string $message = '')

Asserts that a directory exists and is readable.

static 
assertDirectoryNotIsReadable(string $directory, string $message = '')

Asserts that a directory exists and is not readable.

static 
assertDirectoryIsWritable(string $directory, string $message = '')

Asserts that a directory exists and is writable.

static 
assertDirectoryNotIsWritable(string $directory, string $message = '')

Asserts that a directory exists and is not writable.

static 
assertFileExists(string $filename, string $message = '')

Asserts that a file exists.

static 
assertFileNotExists(string $filename, string $message = '')

Asserts that a file does not exist.

static 
assertFileIsReadable(string $file, string $message = '')

Asserts that a file exists and is readable.

static 
assertFileNotIsReadable(string $file, string $message = '')

Asserts that a file exists and is not readable.

static 
assertFileIsWritable(string $file, string $message = '')

Asserts that a file exists and is writable.

static 
assertFileNotIsWritable(string $file, string $message = '')

Asserts that a file exists and is not writable.

static 
assertTrue(bool $condition, string $message = '')

Asserts that a condition is true.

static 
assertNotTrue(bool $condition, string $message = '')

Asserts that a condition is not true.

static 
assertFalse(bool $condition, string $message = '')

Asserts that a condition is false.

static 
assertNotFalse(bool $condition, string $message = '')

Asserts that a condition is not false.

static 
assertNull(mixed $actual, string $message = '')

Asserts that a variable is null.

static 
assertNotNull(mixed $actual, string $message = '')

Asserts that a variable is not null.

static 
assertFinite(mixed $actual, string $message = '')

Asserts that a variable is finite.

static 
assertInfinite(mixed $actual, string $message = '')

Asserts that a variable is infinite.

static 
assertNan(mixed $actual, string $message = '')

Asserts that a variable is nan.

static 
assertClassHasAttribute(string $attributeName, string $className, string $message = '')

Asserts that a class has a specified attribute.

static 
assertClassNotHasAttribute(string $attributeName, string $className, string $message = '')

Asserts that a class does not have a specified attribute.

static 
assertClassHasStaticAttribute(string $attributeName, string $className, string $message = '')

Asserts that a class has a specified static attribute.

static 
assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = '')

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

static 
assertObjectHasAttribute(string $attributeName, object $object, string $message = '')

Asserts that an object has a specified attribute.

static 
assertObjectNotHasAttribute(string $attributeName, object $object, string $message = '')

Asserts that an object does not have a specified attribute.

static 
assertSame(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables have the same type and value.

static 
assertAttributeSame(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

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

static 
assertNotSame(mixed $expected, mixed $actual, string $message = '')

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

static 
assertAttributeNotSame(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

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

static 
assertInstanceOf(string $expected, mixed $actual, string $message = '')

Asserts that a variable is of a given type.

static 
assertAttributeInstanceOf(string $expected, string $attributeName, string|object $classOrObject, string $message = '')

Asserts that an attribute is of a given type.

static 
assertNotInstanceOf(string $expected, mixed $actual, string $message = '')

Asserts that a variable is not of a given type.

static 
assertAttributeNotInstanceOf(string $expected, string $attributeName, string|object $classOrObject, string $message = '')

Asserts that an attribute is of a given type.

static 
assertInternalType(string $expected, mixed $actual, string $message = '')

Asserts that a variable is of a given type.

static 
assertAttributeInternalType(string $expected, string $attributeName, string|object $classOrObject, string $message = '')

Asserts that an attribute is of a given type.

static 
assertNotInternalType(string $expected, mixed $actual, string $message = '')

Asserts that a variable is not of a given type.

static 
assertAttributeNotInternalType(string $expected, string $attributeName, string|object $classOrObject, string $message = '')

Asserts that an attribute is of a given type.

static 
assertRegExp(string $pattern, string $string, string $message = '')

Asserts that a string matches a given regular expression.

static 
assertNotRegExp(string $pattern, string $string, string $message = '')

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

static 
assertSameSize(array|Countable|Traversable $expected, array|Countable|Traversable $actual, string $message = '')

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

static 
assertNotSameSize(array|Countable|Traversable $expected, array|Countable|Traversable $actual, string $message = '')

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

static 
assertStringMatchesFormat(string $format, string $string, string $message = '')

Asserts that a string matches a given format string.

static 
assertStringNotMatchesFormat(string $format, string $string, string $message = '')

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

static 
assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '')

Asserts that a string matches a given format file.

static 
assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = '')

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

static 
assertStringStartsWith(string $prefix, string $string, string $message = '')

Asserts that a string starts with a given prefix.

static 
assertStringStartsNotWith(string $prefix, string $string, string $message = '')

Asserts that a string starts not with a given prefix.

static 
assertStringEndsWith(string $suffix, string $string, string $message = '')

Asserts that a string ends with a given suffix.

static 
assertStringEndsNotWith(string $suffix, string $string, string $message = '')

Asserts that a string ends not with a given suffix.

static 
assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two XML files are equal.

static 
assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two XML files are not equal.

static 
assertXmlStringEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '')

Asserts that two XML documents are equal.

static 
assertXmlStringNotEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '')

Asserts that two XML documents are not equal.

static 
assertXmlStringEqualsXmlString(string $expectedXml, string $actualXml, string $message = '')

Asserts that two XML documents are equal.

static 
assertXmlStringNotEqualsXmlString(string $expectedXml, string $actualXml, string $message = '')

Asserts that two XML documents are not equal.

static 
assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = '')

Asserts that a hierarchy of DOMElements matches.

static 
assertThat(mixed $value, PHPUnit_Framework_Constraint $constraint, string $message = '')

Evaluates a PHPUnit_Framework_Constraint matcher object.

static 
assertJson(string $actualJson, string $message = '')

Asserts that a string is a valid JSON string.

static 
assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '')

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

static 
assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson, string $message = '')

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

static 
assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '')

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

static 
assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '')

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

static 
assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two JSON files are equal.

static 
assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two JSON files are not equal.

logicalAnd()

Returns a PHPUnit_Framework_Constraint_And matcher object.

logicalOr()

Returns a PHPUnit_Framework_Constraint_Or matcher object.

logicalNot(PHPUnit_Framework_Constraint $constraint)

Returns a PHPUnit_Framework_Constraint_Not matcher object.

logicalXor()

Returns a PHPUnit_Framework_Constraint_Xor matcher object.

anything()

Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.

isTrue()

Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.

callback(callable $callback)

Returns a PHPUnit_Framework_Constraint_Callback matcher object.

isFalse()

Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.

isJson()

Returns a PHPUnit_Framework_Constraint_IsJson matcher object.

isNull()

Returns a PHPUnit_Framework_Constraint_IsNull matcher object.

isFinite()

Returns a PHPUnit_Framework_Constraint_IsFinite matcher object.

isInfinite()

Returns a PHPUnit_Framework_Constraint_IsInfinite matcher object.

isNan()

Returns a PHPUnit_Framework_Constraint_IsNan matcher object.

attribute(PHPUnit_Framework_Constraint $constraint, string $attributeName)

Returns a PHPUnit_Framework_Constraint_Attribute matcher object.

contains(mixed $value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

Returns a PHPUnit_Framework_Constraint_TraversableContains matcher object.

containsOnly(string $type)

Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher object.

containsOnlyInstancesOf(string $classname)

Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher object.

arrayHasKey(mixed $key)

Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object.

equalTo(mixed $value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.

attributeEqualTo(string $attributeName, mixed $value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

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

isEmpty()

Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.

isWritable()

Returns a PHPUnit_Framework_Constraint_IsWritable matcher object.

isReadable()

Returns a PHPUnit_Framework_Constraint_IsReadable matcher object.

directoryExists()

Returns a PHPUnit_Framework_Constraint_DirectoryExists matcher object.

fileExists()

Returns a PHPUnit_Framework_Constraint_FileExists matcher object.

greaterThan(mixed $value)

Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.

greaterThanOrEqual(mixed $value)

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

classHasAttribute(string $attributeName)

Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.

classHasStaticAttribute(string $attributeName)

Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher object.

objectHasAttribute(string $attributeName)

Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.

identicalTo(mixed $value)

Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.

isInstanceOf(string $className)

Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.

isType(string $type)

Returns a PHPUnit_Framework_Constraint_IsType matcher object.

lessThan(mixed $value)

Returns a PHPUnit_Framework_Constraint_LessThan matcher object.

lessThanOrEqual(mixed $value)

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

matchesRegularExpression(string $pattern)

Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.

matches(string $string)

Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.

stringStartsWith(mixed $prefix)

Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.

stringContains(string $string, bool $case = true)

Returns a PHPUnit_Framework_Constraint_StringContains matcher object.

stringEndsWith(mixed $suffix)

Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.

countOf(int $count)

Returns a PHPUnit_Framework_Constraint_Count matcher object.

static 
fail(string $message = '')

Fails a test with the given message.

static mixed
readAttribute(string|object $classOrObject, string $attributeName)

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

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

Returns the value of a static attribute.

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

Returns the value of an object's attribute.

static 
markTestIncomplete(string $message = '')

Mark the test as incomplete.

static 
markTestSkipped(string $message = '')

Mark the test as skipped.

static int
getCount()

Return the current assertion count.

static 
resetCount()

Reset the assertion counter.

__construct(PHPUnit_Framework_Test $test)

Constructor.

string
toString()

Returns a string representation of the test.

basicRun(PHPUnit_Framework_TestResult $result)

Runs the test and collects the result in a TestResult.

int
count()

Counts the number of test cases that will be run by this test.

createResult()

Creates a default TestResult object.

getTest()

Returns the test to be run.

run(PHPUnit_Framework_TestResult $result = null)

Runs the decorated test and collects the result in a TestResult.

Details

static assertArrayHasKey(mixed $key, array|ArrayAccess $array, string $message = '')

Asserts that an array has a specified key.

Parameters

mixed $key
array|ArrayAccess $array
string $message

static assertArraySubset(array|ArrayAccess $subset, array|ArrayAccess $array, bool $strict = false, string $message = '')

Asserts that an array has a specified subset.

Parameters

array|ArrayAccess $subset
array|ArrayAccess $array
bool $strict Check for object identity
string $message

static assertArrayNotHasKey(mixed $key, array|ArrayAccess $array, string $message = '')

Asserts that an array does not have a specified key.

Parameters

mixed $key
array|ArrayAccess $array
string $message

static assertContains(mixed $needle, mixed $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

Asserts that a haystack contains a needle.

Parameters

mixed $needle
mixed $haystack
string $message
bool $ignoreCase
bool $checkForObjectIdentity
bool $checkForNonObjectIdentity

static assertAttributeContains(mixed $needle, string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

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

Parameters

mixed $needle
string $haystackAttributeName
string|object $haystackClassOrObject
string $message
bool $ignoreCase
bool $checkForObjectIdentity
bool $checkForNonObjectIdentity

static assertNotContains(mixed $needle, mixed $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

Asserts that a haystack does not contain a needle.

Parameters

mixed $needle
mixed $haystack
string $message
bool $ignoreCase
bool $checkForObjectIdentity
bool $checkForNonObjectIdentity

static assertAttributeNotContains(mixed $needle, string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

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.

Parameters

mixed $needle
string $haystackAttributeName
string|object $haystackClassOrObject
string $message
bool $ignoreCase
bool $checkForObjectIdentity
bool $checkForNonObjectIdentity

static assertContainsOnly(string $type, mixed $haystack, bool $isNativeType = null, string $message = '')

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

Parameters

string $type
mixed $haystack
bool $isNativeType
string $message

static assertContainsOnlyInstancesOf(string $classname, array|Traversable $haystack, string $message = '')

Asserts that a haystack contains only instances of a given classname

Parameters

string $classname
array|Traversable $haystack
string $message

static assertAttributeContainsOnly(string $type, string $haystackAttributeName, string|object $haystackClassOrObject, bool $isNativeType = null, string $message = '')

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.

Parameters

string $type
string $haystackAttributeName
string|object $haystackClassOrObject
bool $isNativeType
string $message

static assertNotContainsOnly(string $type, mixed $haystack, bool $isNativeType = null, string $message = '')

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

Parameters

string $type
mixed $haystack
bool $isNativeType
string $message

static assertAttributeNotContainsOnly(string $type, string $haystackAttributeName, string|object $haystackClassOrObject, bool $isNativeType = null, string $message = '')

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.

Parameters

string $type
string $haystackAttributeName
string|object $haystackClassOrObject
bool $isNativeType
string $message

static assertCount(int $expectedCount, mixed $haystack, string $message = '')

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

Parameters

int $expectedCount
mixed $haystack
string $message

static assertAttributeCount(int $expectedCount, string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '')

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

Parameters

int $expectedCount
string $haystackAttributeName
string|object $haystackClassOrObject
string $message

static assertNotCount(int $expectedCount, mixed $haystack, string $message = '')

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

Parameters

int $expectedCount
mixed $haystack
string $message

static assertAttributeNotCount(int $expectedCount, string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '')

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

Parameters

int $expectedCount
string $haystackAttributeName
string|object $haystackClassOrObject
string $message

static assertEquals(mixed $expected, mixed $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

Asserts that two variables are equal.

Parameters

mixed $expected
mixed $actual
string $message
float $delta
int $maxDepth
bool $canonicalize
bool $ignoreCase

static assertAttributeEquals(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

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

Parameters

mixed $expected
string $actualAttributeName
string|object $actualClassOrObject
string $message
float $delta
int $maxDepth
bool $canonicalize
bool $ignoreCase

static assertNotEquals(mixed $expected, mixed $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

Asserts that two variables are not equal.

Parameters

mixed $expected
mixed $actual
string $message
float $delta
int $maxDepth
bool $canonicalize
bool $ignoreCase

static assertAttributeNotEquals(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

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

Parameters

mixed $expected
string $actualAttributeName
string|object $actualClassOrObject
string $message
float $delta
int $maxDepth
bool $canonicalize
bool $ignoreCase

static assertEmpty(mixed $actual, string $message = '')

Asserts that a variable is empty.

Parameters

mixed $actual
string $message

Exceptions

PHPUnit_Framework_AssertionFailedError

static assertAttributeEmpty(string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '')

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

Parameters

string $haystackAttributeName
string|object $haystackClassOrObject
string $message

static assertNotEmpty(mixed $actual, string $message = '')

Asserts that a variable is not empty.

Parameters

mixed $actual
string $message

Exceptions

PHPUnit_Framework_AssertionFailedError

static assertAttributeNotEmpty(string $haystackAttributeName, string|object $haystackClassOrObject, string $message = '')

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

Parameters

string $haystackAttributeName
string|object $haystackClassOrObject
string $message

static assertGreaterThan(mixed $expected, mixed $actual, string $message = '')

Asserts that a value is greater than another value.

Parameters

mixed $expected
mixed $actual
string $message

static assertAttributeGreaterThan(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

Asserts that an attribute is greater than another value.

Parameters

mixed $expected
string $actualAttributeName
string|object $actualClassOrObject
string $message

static assertGreaterThanOrEqual(mixed $expected, mixed $actual, string $message = '')

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

Parameters

mixed $expected
mixed $actual
string $message

static assertAttributeGreaterThanOrEqual(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

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

Parameters

mixed $expected
string $actualAttributeName
string|object $actualClassOrObject
string $message

static assertLessThan(mixed $expected, mixed $actual, string $message = '')

Asserts that a value is smaller than another value.

Parameters

mixed $expected
mixed $actual
string $message

static assertAttributeLessThan(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

Asserts that an attribute is smaller than another value.

Parameters

mixed $expected
string $actualAttributeName
string|object $actualClassOrObject
string $message

static assertLessThanOrEqual(mixed $expected, mixed $actual, string $message = '')

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

Parameters

mixed $expected
mixed $actual
string $message

static assertAttributeLessThanOrEqual(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

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

Parameters

mixed $expected
string $actualAttributeName
string|object $actualClassOrObject
string $message

static assertFileEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false)

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

Parameters

string $expected
string $actual
string $message
bool $canonicalize
bool $ignoreCase

static assertFileNotEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false)

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

Parameters

string $expected
string $actual
string $message
bool $canonicalize
bool $ignoreCase

static assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false)

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

Parameters

string $expectedFile
string $actualString
string $message
bool $canonicalize
bool $ignoreCase

static assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false)

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

Parameters

string $expectedFile
string $actualString
string $message
bool $canonicalize
bool $ignoreCase

static assertIsReadable(string $filename, string $message = '')

Asserts that a file/dir is readable.

Parameters

string $filename
string $message

static assertNotIsReadable(string $filename, string $message = '')

Asserts that a file/dir exists and is not readable.

Parameters

string $filename
string $message

static assertIsWritable(string $filename, string $message = '')

Asserts that a file/dir exists and is writable.

Parameters

string $filename
string $message

static assertNotIsWritable(string $filename, string $message = '')

Asserts that a file/dir exists and is not writable.

Parameters

string $filename
string $message

static assertDirectoryExists(string $directory, string $message = '')

Asserts that a directory exists.

Parameters

string $directory
string $message

static assertDirectoryNotExists(string $directory, string $message = '')

Asserts that a directory does not exist.

Parameters

string $directory
string $message

static assertDirectoryIsReadable(string $directory, string $message = '')

Asserts that a directory exists and is readable.

Parameters

string $directory
string $message

static assertDirectoryNotIsReadable(string $directory, string $message = '')

Asserts that a directory exists and is not readable.

Parameters

string $directory
string $message

static assertDirectoryIsWritable(string $directory, string $message = '')

Asserts that a directory exists and is writable.

Parameters

string $directory
string $message

static assertDirectoryNotIsWritable(string $directory, string $message = '')

Asserts that a directory exists and is not writable.

Parameters

string $directory
string $message

static assertFileExists(string $filename, string $message = '')

Asserts that a file exists.

Parameters

string $filename
string $message

static assertFileNotExists(string $filename, string $message = '')

Asserts that a file does not exist.

Parameters

string $filename
string $message

static assertFileIsReadable(string $file, string $message = '')

Asserts that a file exists and is readable.

Parameters

string $file
string $message

static assertFileNotIsReadable(string $file, string $message = '')

Asserts that a file exists and is not readable.

Parameters

string $file
string $message

static assertFileIsWritable(string $file, string $message = '')

Asserts that a file exists and is writable.

Parameters

string $file
string $message

static assertFileNotIsWritable(string $file, string $message = '')

Asserts that a file exists and is not writable.

Parameters

string $file
string $message

static assertTrue(bool $condition, string $message = '')

Asserts that a condition is true.

Parameters

bool $condition
string $message

Exceptions

PHPUnit_Framework_AssertionFailedError

static assertNotTrue(bool $condition, string $message = '')

Asserts that a condition is not true.

Parameters

bool $condition
string $message

Exceptions

PHPUnit_Framework_AssertionFailedError

static assertFalse(bool $condition, string $message = '')

Asserts that a condition is false.

Parameters

bool $condition
string $message

Exceptions

PHPUnit_Framework_AssertionFailedError

static assertNotFalse(bool $condition, string $message = '')

Asserts that a condition is not false.

Parameters

bool $condition
string $message

Exceptions

PHPUnit_Framework_AssertionFailedError

static assertNull(mixed $actual, string $message = '')

Asserts that a variable is null.

Parameters

mixed $actual
string $message

static assertNotNull(mixed $actual, string $message = '')

Asserts that a variable is not null.

Parameters

mixed $actual
string $message

static assertFinite(mixed $actual, string $message = '')

Asserts that a variable is finite.

Parameters

mixed $actual
string $message

static assertInfinite(mixed $actual, string $message = '')

Asserts that a variable is infinite.

Parameters

mixed $actual
string $message

static assertNan(mixed $actual, string $message = '')

Asserts that a variable is nan.

Parameters

mixed $actual
string $message

static assertClassHasAttribute(string $attributeName, string $className, string $message = '')

Asserts that a class has a specified attribute.

Parameters

string $attributeName
string $className
string $message

static assertClassNotHasAttribute(string $attributeName, string $className, string $message = '')

Asserts that a class does not have a specified attribute.

Parameters

string $attributeName
string $className
string $message

static assertClassHasStaticAttribute(string $attributeName, string $className, string $message = '')

Asserts that a class has a specified static attribute.

Parameters

string $attributeName
string $className
string $message

static assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = '')

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

Parameters

string $attributeName
string $className
string $message

static assertObjectHasAttribute(string $attributeName, object $object, string $message = '')

Asserts that an object has a specified attribute.

Parameters

string $attributeName
object $object
string $message

static assertObjectNotHasAttribute(string $attributeName, object $object, string $message = '')

Asserts that an object does not have a specified attribute.

Parameters

string $attributeName
object $object
string $message

static assertSame(mixed $expected, mixed $actual, string $message = '')

Asserts that two variables have the same type and value.

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

Parameters

mixed $expected
mixed $actual
string $message

static assertAttributeSame(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

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

Parameters

mixed $expected
string $actualAttributeName
string|object $actualClassOrObject
string $message

static assertNotSame(mixed $expected, mixed $actual, string $message = '')

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

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

Parameters

mixed $expected
mixed $actual
string $message

static assertAttributeNotSame(mixed $expected, string $actualAttributeName, string|object $actualClassOrObject, string $message = '')

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

Parameters

mixed $expected
string $actualAttributeName
string|object $actualClassOrObject
string $message

static assertInstanceOf(string $expected, mixed $actual, string $message = '')

Asserts that a variable is of a given type.

Parameters

string $expected
mixed $actual
string $message

static assertAttributeInstanceOf(string $expected, string $attributeName, string|object $classOrObject, string $message = '')

Asserts that an attribute is of a given type.

Parameters

string $expected
string $attributeName
string|object $classOrObject
string $message

static assertNotInstanceOf(string $expected, mixed $actual, string $message = '')

Asserts that a variable is not of a given type.

Parameters

string $expected
mixed $actual
string $message

static assertAttributeNotInstanceOf(string $expected, string $attributeName, string|object $classOrObject, string $message = '')

Asserts that an attribute is of a given type.

Parameters

string $expected
string $attributeName
string|object $classOrObject
string $message

static assertInternalType(string $expected, mixed $actual, string $message = '')

Asserts that a variable is of a given type.

Parameters

string $expected
mixed $actual
string $message

static assertAttributeInternalType(string $expected, string $attributeName, string|object $classOrObject, string $message = '')

Asserts that an attribute is of a given type.

Parameters

string $expected
string $attributeName
string|object $classOrObject
string $message

static assertNotInternalType(string $expected, mixed $actual, string $message = '')

Asserts that a variable is not of a given type.

Parameters

string $expected
mixed $actual
string $message

static assertAttributeNotInternalType(string $expected, string $attributeName, string|object $classOrObject, string $message = '')

Asserts that an attribute is of a given type.

Parameters

string $expected
string $attributeName
string|object $classOrObject
string $message

static assertRegExp(string $pattern, string $string, string $message = '')

Asserts that a string matches a given regular expression.

Parameters

string $pattern
string $string
string $message

static assertNotRegExp(string $pattern, string $string, string $message = '')

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

Parameters

string $pattern
string $string
string $message

static assertSameSize(array|Countable|Traversable $expected, array|Countable|Traversable $actual, string $message = '')

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

Parameters

array|Countable|Traversable $expected
array|Countable|Traversable $actual
string $message

static assertNotSameSize(array|Countable|Traversable $expected, array|Countable|Traversable $actual, string $message = '')

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

Parameters

array|Countable|Traversable $expected
array|Countable|Traversable $actual
string $message

static assertStringMatchesFormat(string $format, string $string, string $message = '')

Asserts that a string matches a given format string.

Parameters

string $format
string $string
string $message

static assertStringNotMatchesFormat(string $format, string $string, string $message = '')

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

Parameters

string $format
string $string
string $message

static assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '')

Asserts that a string matches a given format file.

Parameters

string $formatFile
string $string
string $message

static assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = '')

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

Parameters

string $formatFile
string $string
string $message

static assertStringStartsWith(string $prefix, string $string, string $message = '')

Asserts that a string starts with a given prefix.

Parameters

string $prefix
string $string
string $message

static assertStringStartsNotWith(string $prefix, string $string, string $message = '')

Asserts that a string starts not with a given prefix.

Parameters

string $prefix
string $string
string $message

static assertStringEndsWith(string $suffix, string $string, string $message = '')

Asserts that a string ends with a given suffix.

Parameters

string $suffix
string $string
string $message

static assertStringEndsNotWith(string $suffix, string $string, string $message = '')

Asserts that a string ends not with a given suffix.

Parameters

string $suffix
string $string
string $message

static assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two XML files are equal.

Parameters

string $expectedFile
string $actualFile
string $message

static assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two XML files are not equal.

Parameters

string $expectedFile
string $actualFile
string $message

static assertXmlStringEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '')

Asserts that two XML documents are equal.

Parameters

string $expectedFile
string $actualXml
string $message

static assertXmlStringNotEqualsXmlFile(string $expectedFile, string $actualXml, string $message = '')

Asserts that two XML documents are not equal.

Parameters

string $expectedFile
string $actualXml
string $message

static assertXmlStringEqualsXmlString(string $expectedXml, string $actualXml, string $message = '')

Asserts that two XML documents are equal.

Parameters

string $expectedXml
string $actualXml
string $message

static assertXmlStringNotEqualsXmlString(string $expectedXml, string $actualXml, string $message = '')

Asserts that two XML documents are not equal.

Parameters

string $expectedXml
string $actualXml
string $message

static assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = '')

Asserts that a hierarchy of DOMElements matches.

Parameters

DOMElement $expectedElement
DOMElement $actualElement
bool $checkAttributes
string $message

static assertThat(mixed $value, PHPUnit_Framework_Constraint $constraint, string $message = '')

Evaluates a PHPUnit_Framework_Constraint matcher object.

Parameters

mixed $value
PHPUnit_Framework_Constraint $constraint
string $message

static assertJson(string $actualJson, string $message = '')

Asserts that a string is a valid JSON string.

Parameters

string $actualJson
string $message

static assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '')

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

Parameters

string $expectedJson
string $actualJson
string $message

static assertJsonStringNotEqualsJsonString(string $expectedJson, string $actualJson, string $message = '')

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

Parameters

string $expectedJson
string $actualJson
string $message

static assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '')

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

Parameters

string $expectedFile
string $actualJson
string $message

static assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '')

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

Parameters

string $expectedFile
string $actualJson
string $message

static assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two JSON files are equal.

Parameters

string $expectedFile
string $actualFile
string $message

static assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '')

Asserts that two JSON files are not equal.

Parameters

string $expectedFile
string $actualFile
string $message

static PHPUnit_Framework_Constraint_And logicalAnd()

Returns a PHPUnit_Framework_Constraint_And matcher object.

static PHPUnit_Framework_Constraint_Or logicalOr()

Returns a PHPUnit_Framework_Constraint_Or matcher object.

static PHPUnit_Framework_Constraint_Not logicalNot(PHPUnit_Framework_Constraint $constraint)

Returns a PHPUnit_Framework_Constraint_Not matcher object.

static PHPUnit_Framework_Constraint_Xor logicalXor()

Returns a PHPUnit_Framework_Constraint_Xor matcher object.

static PHPUnit_Framework_Constraint_IsAnything anything()

Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.

static PHPUnit_Framework_Constraint_IsTrue isTrue()

Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.

static PHPUnit_Framework_Constraint_Callback callback(callable $callback)

Returns a PHPUnit_Framework_Constraint_Callback matcher object.

Parameters

callable $callback

Return Value

PHPUnit_Framework_Constraint_Callback

static PHPUnit_Framework_Constraint_IsFalse isFalse()

Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.

static PHPUnit_Framework_Constraint_IsJson isJson()

Returns a PHPUnit_Framework_Constraint_IsJson matcher object.

static PHPUnit_Framework_Constraint_IsNull isNull()

Returns a PHPUnit_Framework_Constraint_IsNull matcher object.

static PHPUnit_Framework_Constraint_IsFinite isFinite()

Returns a PHPUnit_Framework_Constraint_IsFinite matcher object.

static PHPUnit_Framework_Constraint_IsInfinite isInfinite()

Returns a PHPUnit_Framework_Constraint_IsInfinite matcher object.

static PHPUnit_Framework_Constraint_IsNan isNan()

Returns a PHPUnit_Framework_Constraint_IsNan matcher object.

static PHPUnit_Framework_Constraint_Attribute attribute(PHPUnit_Framework_Constraint $constraint, string $attributeName)

Returns a PHPUnit_Framework_Constraint_Attribute matcher object.

Parameters

PHPUnit_Framework_Constraint $constraint
string $attributeName

Return Value

PHPUnit_Framework_Constraint_Attribute

static PHPUnit_Framework_Constraint_TraversableContains contains(mixed $value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)

Returns a PHPUnit_Framework_Constraint_TraversableContains matcher object.

Parameters

mixed $value
bool $checkForObjectIdentity
bool $checkForNonObjectIdentity

Return Value

PHPUnit_Framework_Constraint_TraversableContains

static PHPUnit_Framework_Constraint_TraversableContainsOnly containsOnly(string $type)

Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher object.

Parameters

string $type

Return Value

PHPUnit_Framework_Constraint_TraversableContainsOnly

static PHPUnit_Framework_Constraint_TraversableContainsOnly containsOnlyInstancesOf(string $classname)

Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher object.

Parameters

string $classname

Return Value

PHPUnit_Framework_Constraint_TraversableContainsOnly

static PHPUnit_Framework_Constraint_ArrayHasKey arrayHasKey(mixed $key)

Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object.

Parameters

mixed $key

Return Value

PHPUnit_Framework_Constraint_ArrayHasKey

static PHPUnit_Framework_Constraint_IsEqual equalTo(mixed $value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.

Parameters

mixed $value
float $delta
int $maxDepth
bool $canonicalize
bool $ignoreCase

Return Value

PHPUnit_Framework_Constraint_IsEqual

static PHPUnit_Framework_Constraint_Attribute attributeEqualTo(string $attributeName, mixed $value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)

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

Parameters

string $attributeName
mixed $value
float $delta
int $maxDepth
bool $canonicalize
bool $ignoreCase

Return Value

PHPUnit_Framework_Constraint_Attribute

static PHPUnit_Framework_Constraint_IsEmpty isEmpty()

Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.

static PHPUnit_Framework_Constraint_IsWritable isWritable()

Returns a PHPUnit_Framework_Constraint_IsWritable matcher object.

static PHPUnit_Framework_Constraint_IsReadable isReadable()

Returns a PHPUnit_Framework_Constraint_IsReadable matcher object.

static PHPUnit_Framework_Constraint_DirectoryExists directoryExists()

Returns a PHPUnit_Framework_Constraint_DirectoryExists matcher object.

static PHPUnit_Framework_Constraint_FileExists fileExists()

Returns a PHPUnit_Framework_Constraint_FileExists matcher object.

static PHPUnit_Framework_Constraint_GreaterThan greaterThan(mixed $value)

Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.

Parameters

mixed $value

Return Value

PHPUnit_Framework_Constraint_GreaterThan

static PHPUnit_Framework_Constraint_Or greaterThanOrEqual(mixed $value)

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

Parameters

mixed $value

Return Value

PHPUnit_Framework_Constraint_Or

static PHPUnit_Framework_Constraint_ClassHasAttribute classHasAttribute(string $attributeName)

Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.

Parameters

string $attributeName

Return Value

PHPUnit_Framework_Constraint_ClassHasAttribute

static PHPUnit_Framework_Constraint_ClassHasStaticAttribute classHasStaticAttribute(string $attributeName)

Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher object.

Parameters

string $attributeName

Return Value

PHPUnit_Framework_Constraint_ClassHasStaticAttribute

static PHPUnit_Framework_Constraint_ObjectHasAttribute objectHasAttribute(string $attributeName)

Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.

Parameters

string $attributeName

Return Value

PHPUnit_Framework_Constraint_ObjectHasAttribute

static PHPUnit_Framework_Constraint_IsIdentical identicalTo(mixed $value)

Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.

Parameters

mixed $value

Return Value

PHPUnit_Framework_Constraint_IsIdentical

static PHPUnit_Framework_Constraint_IsInstanceOf isInstanceOf(string $className)

Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.

Parameters

string $className

Return Value

PHPUnit_Framework_Constraint_IsInstanceOf

static PHPUnit_Framework_Constraint_IsType isType(string $type)

Returns a PHPUnit_Framework_Constraint_IsType matcher object.

Parameters

string $type

Return Value

PHPUnit_Framework_Constraint_IsType

static PHPUnit_Framework_Constraint_LessThan lessThan(mixed $value)

Returns a PHPUnit_Framework_Constraint_LessThan matcher object.

Parameters

mixed $value

Return Value

PHPUnit_Framework_Constraint_LessThan

static PHPUnit_Framework_Constraint_Or lessThanOrEqual(mixed $value)

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

Parameters

mixed $value

Return Value

PHPUnit_Framework_Constraint_Or

static PHPUnit_Framework_Constraint_PCREMatch matchesRegularExpression(string $pattern)

Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.

Parameters

string $pattern

Return Value

PHPUnit_Framework_Constraint_PCREMatch

static PHPUnit_Framework_Constraint_StringMatches matches(string $string)

Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.

Parameters

string $string

Return Value

PHPUnit_Framework_Constraint_StringMatches

static PHPUnit_Framework_Constraint_StringStartsWith stringStartsWith(mixed $prefix)

Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.

Parameters

mixed $prefix

Return Value

PHPUnit_Framework_Constraint_StringStartsWith

static PHPUnit_Framework_Constraint_StringContains stringContains(string $string, bool $case = true)

Returns a PHPUnit_Framework_Constraint_StringContains matcher object.

Parameters

string $string
bool $case

Return Value

PHPUnit_Framework_Constraint_StringContains

static PHPUnit_Framework_Constraint_StringEndsWith stringEndsWith(mixed $suffix)

Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.

Parameters

mixed $suffix

Return Value

PHPUnit_Framework_Constraint_StringEndsWith

static PHPUnit_Framework_Constraint_Count countOf(int $count)

Returns a PHPUnit_Framework_Constraint_Count matcher object.

Parameters

int $count

Return Value

PHPUnit_Framework_Constraint_Count

static fail(string $message = '')

Fails a test with the given message.

Parameters

string $message

Exceptions

PHPUnit_Framework_AssertionFailedError

static mixed readAttribute(string|object $classOrObject, string $attributeName)

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

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

Parameters

string|object $classOrObject
string $attributeName

Return Value

mixed

Exceptions

PHPUnit_Framework_Exception

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

Returns the value of a static attribute.

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

Parameters

string $className
string $attributeName

Return Value

mixed

Exceptions

PHPUnit_Framework_Exception

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

Returns the value of an object's attribute.

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

Parameters

object $object
string $attributeName

Return Value

mixed

Exceptions

PHPUnit_Framework_Exception

static markTestIncomplete(string $message = '')

Mark the test as incomplete.

Parameters

string $message

Exceptions

PHPUnit_Framework_IncompleteTestError

static markTestSkipped(string $message = '')

Mark the test as skipped.

Parameters

string $message

Exceptions

PHPUnit_Framework_SkippedTestError

static int getCount()

Return the current assertion count.

Return Value

int

static resetCount()

Reset the assertion counter.

__construct(PHPUnit_Framework_Test $test)

Constructor.

Parameters

PHPUnit_Framework_Test $test

string toString()

Returns a string representation of the test.

Return Value

string

basicRun(PHPUnit_Framework_TestResult $result)

Runs the test and collects the result in a TestResult.

Parameters

PHPUnit_Framework_TestResult $result

int count()

Counts the number of test cases that will be run by this test.

Return Value

int

protected PHPUnit_Framework_TestResult createResult()

Creates a default TestResult object.

PHPUnit_Framework_Test getTest()

Returns the test to be run.

Return Value

PHPUnit_Framework_Test

PHPUnit_Framework_TestResult run(PHPUnit_Framework_TestResult $result = null)

Runs the decorated test and collects the result in a TestResult.