class (none) \ PHPUnit_Extensions_TestDecorator

All implemented interfaces:
Countable, PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing
All known direct subclasses:
PHPUnit_Extensions_RepeatedTest

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.


Method Summary

Name Description
__construct(PHPUnit_Framework_Test $test)Constructor.
basicRun(PHPUnit_Framework_TestResult $result)Runs the test and collects the result in a TestResult.
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.
toString()Returns a string representation of the test.

Inherited Method Summary

Name Description
anything()Returns a PHPUnit_Framework_Constraint_IsAnything matcher object. (from PHPUnit_Framework_Assert)
arrayHasKey($key)Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object. (from PHPUnit_Framework_Assert)
assertArrayHasKey($key, $array, $message = "")Asserts that an array has a specified key. (from PHPUnit_Framework_Assert)
assertArrayNotHasKey($key, $array, $message = "")Asserts that an array does not have a specified key. (from PHPUnit_Framework_Assert)
assertArraySubset($subset, $array, $strict = false, $message = "")Asserts that an array has a specified subset. (from PHPUnit_Framework_Assert)
assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = "", $ignoreCase = false, $checkForObjectIdentity = true, $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. (from PHPUnit_Framework_Assert)
assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $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. (from PHPUnit_Framework_Assert)
assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = "")Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute. (from PHPUnit_Framework_Assert)
assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message = "")Asserts that a static attribute of a class or an attribute of an object is empty. (from PHPUnit_Framework_Assert)
assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message = "", $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)Asserts that a variable is equal to an attribute of an object. (from PHPUnit_Framework_Assert)
assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message = "")Asserts that an attribute is greater than another value. (from PHPUnit_Framework_Assert)
assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = "")Asserts that an attribute is greater than or equal to another value. (from PHPUnit_Framework_Assert)
assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = "")Asserts that an attribute is of a given type. (from PHPUnit_Framework_Assert)
assertAttributeInternalType($expected, $attributeName, $classOrObject, $message = "")Asserts that an attribute is of a given type. (from PHPUnit_Framework_Assert)
assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = "")Asserts that an attribute is smaller than another value. (from PHPUnit_Framework_Assert)
assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = "")Asserts that an attribute is smaller than or equal to another value. (from PHPUnit_Framework_Assert)
assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = "", $ignoreCase = false, $checkForObjectIdentity = true, $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. (from PHPUnit_Framework_Assert)
assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $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. (from PHPUnit_Framework_Assert)
assertAttributeNotCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = "")Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute. (from PHPUnit_Framework_Assert)
assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message = "")Asserts that a static attribute of a class or an attribute of an object is not empty. (from PHPUnit_Framework_Assert)
assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message = "", $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)Asserts that a variable is not equal to an attribute of an object. (from PHPUnit_Framework_Assert)
assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message = "")Asserts that an attribute is of a given type. (from PHPUnit_Framework_Assert)
assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message = "")Asserts that an attribute is of a given type. (from PHPUnit_Framework_Assert)
assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message = "")Asserts that a variable and an attribute of an object do not have the same type and value. (from PHPUnit_Framework_Assert)
assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = "")Asserts that a variable and an attribute of an object have the same type and value. (from PHPUnit_Framework_Assert)
assertClassHasAttribute($attributeName, $className, $message = "")Asserts that a class has a specified attribute. (from PHPUnit_Framework_Assert)
assertClassHasStaticAttribute($attributeName, $className, $message = "")Asserts that a class has a specified static attribute. (from PHPUnit_Framework_Assert)
assertClassNotHasAttribute($attributeName, $className, $message = "")Asserts that a class does not have a specified attribute. (from PHPUnit_Framework_Assert)
assertClassNotHasStaticAttribute($attributeName, $className, $message = "")Asserts that a class does not have a specified static attribute. (from PHPUnit_Framework_Assert)
assertContains($needle, $haystack, $message = "", $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)Asserts that a haystack contains a needle. (from PHPUnit_Framework_Assert)
assertContainsOnly($type, $haystack, $isNativeType = null, $message = "")Asserts that a haystack contains only values of a given type. (from PHPUnit_Framework_Assert)
assertContainsOnlyInstancesOf($classname, $haystack, $message = "")Asserts that a haystack contains only instances of a given classname (from PHPUnit_Framework_Assert)
assertCount($expectedCount, $haystack, $message = "")Asserts the number of elements of an array, Countable or Traversable. (from PHPUnit_Framework_Assert)
assertEmpty($actual, $message = "")Asserts that a variable is empty. (from PHPUnit_Framework_Assert)
assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, $checkAttributes = false, $message = "")Asserts that a hierarchy of DOMElements matches. (from PHPUnit_Framework_Assert)
assertEquals($expected, $actual, $message = "", $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)Asserts that two variables are equal. (from PHPUnit_Framework_Assert)
assertFalse($condition, $message = "")Asserts that a condition is false. (from PHPUnit_Framework_Assert)
assertFileEquals($expected, $actual, $message = "", $canonicalize = false, $ignoreCase = false)Asserts that the contents of one file is equal to the contents of another file. (from PHPUnit_Framework_Assert)
assertFileExists($filename, $message = "")Asserts that a file exists. (from PHPUnit_Framework_Assert)
assertFileNotEquals($expected, $actual, $message = "", $canonicalize = false, $ignoreCase = false)Asserts that the contents of one file is not equal to the contents of another file. (from PHPUnit_Framework_Assert)
assertFileNotExists($filename, $message = "")Asserts that a file does not exist. (from PHPUnit_Framework_Assert)
assertGreaterThan($expected, $actual, $message = "")Asserts that a value is greater than another value. (from PHPUnit_Framework_Assert)
assertGreaterThanOrEqual($expected, $actual, $message = "")Asserts that a value is greater than or equal to another value. (from PHPUnit_Framework_Assert)
assertInstanceOf($expected, $actual, $message = "")Asserts that a variable is of a given type. (from PHPUnit_Framework_Assert)
assertInternalType($expected, $actual, $message = "")Asserts that a variable is of a given type. (from PHPUnit_Framework_Assert)
assertJson($actualJson, $message = "")Asserts that a string is a valid JSON string. (from PHPUnit_Framework_Assert)
assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = "")Asserts that two JSON files are equal. (from PHPUnit_Framework_Assert)
assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = "")Asserts that two JSON files are not equal. (from PHPUnit_Framework_Assert)
assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = "")Asserts that the generated JSON encoded object and the content of the given file are equal. (from PHPUnit_Framework_Assert)
assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = "")Asserts that two given JSON encoded objects or arrays are equal. (from PHPUnit_Framework_Assert)
assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = "")Asserts that the generated JSON encoded object and the content of the given file are not equal. (from PHPUnit_Framework_Assert)
assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = "")Asserts that two given JSON encoded objects or arrays are not equal. (from PHPUnit_Framework_Assert)
assertLessThan($expected, $actual, $message = "")Asserts that a value is smaller than another value. (from PHPUnit_Framework_Assert)
assertLessThanOrEqual($expected, $actual, $message = "")Asserts that a value is smaller than or equal to another value. (from PHPUnit_Framework_Assert)
assertNotContains($needle, $haystack, $message = "", $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)Asserts that a haystack does not contain a needle. (from PHPUnit_Framework_Assert)
assertNotContainsOnly($type, $haystack, $isNativeType = null, $message = "")Asserts that a haystack does not contain only values of a given type. (from PHPUnit_Framework_Assert)
assertNotCount($expectedCount, $haystack, $message = "")Asserts the number of elements of an array, Countable or Traversable. (from PHPUnit_Framework_Assert)
assertNotEmpty($actual, $message = "")Asserts that a variable is not empty. (from PHPUnit_Framework_Assert)
assertNotEquals($expected, $actual, $message = "", $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)Asserts that two variables are not equal. (from PHPUnit_Framework_Assert)
assertNotFalse($condition, $message = "")Asserts that a condition is not false. (from PHPUnit_Framework_Assert)
assertNotInstanceOf($expected, $actual, $message = "")Asserts that a variable is not of a given type. (from PHPUnit_Framework_Assert)
assertNotInternalType($expected, $actual, $message = "")Asserts that a variable is not of a given type. (from PHPUnit_Framework_Assert)
assertNotNull($actual, $message = "")Asserts that a variable is not null. (from PHPUnit_Framework_Assert)
assertNotRegExp($pattern, $string, $message = "")Asserts that a string does not match a given regular expression. (from PHPUnit_Framework_Assert)
assertNotSame($expected, $actual, $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. (from PHPUnit_Framework_Assert)
assertNotSameSize($expected, $actual, $message = "")Assert that the size of two arrays (or Countable or Traversable objects) is not the same. (from PHPUnit_Framework_Assert)
assertNotTag($matcher, $actual, $message = "", $isHtml = true)This assertion is the exact opposite of assertTag(). (from PHPUnit_Framework_Assert)
assertNotTrue($condition, $message = "")Asserts that a condition is not true. (from PHPUnit_Framework_Assert)
assertNull($actual, $message = "")Asserts that a variable is null. (from PHPUnit_Framework_Assert)
assertObjectHasAttribute($attributeName, $object, $message = "")Asserts that an object has a specified attribute. (from PHPUnit_Framework_Assert)
assertObjectNotHasAttribute($attributeName, $object, $message = "")Asserts that an object does not have a specified attribute. (from PHPUnit_Framework_Assert)
assertRegExp($pattern, $string, $message = "")Asserts that a string matches a given regular expression. (from PHPUnit_Framework_Assert)
assertSame($expected, $actual, $message = "")Asserts that two variables have the same type and value. Used on objects, it asserts that two variables reference the same object. (from PHPUnit_Framework_Assert)
assertSameSize($expected, $actual, $message = "")Assert that the size of two arrays (or Countable or Traversable objects) is the same. (from PHPUnit_Framework_Assert)
assertSelectCount($selector, $count, $actual, $message = "", $isHtml = true)Assert the presence, absence, or count of elements in a document matching the CSS $selector, regardless of the contents of those elements. (from PHPUnit_Framework_Assert)
assertSelectEquals($selector, $content, $count, $actual, $message = "", $isHtml = true)assertSelectEquals("#binder .name", "Chuck", true, $xml); // any? assertSelectEquals("#binder .name", "Chuck", false, $xml); // none? (from PHPUnit_Framework_Assert)
assertSelectRegExp($selector, $pattern, $count, $actual, $message = "", $isHtml = true)assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any? assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml); // 3? (from PHPUnit_Framework_Assert)
assertStringEndsNotWith($suffix, $string, $message = "")Asserts that a string ends not with a given suffix. (from PHPUnit_Framework_Assert)
assertStringEndsWith($suffix, $string, $message = "")Asserts that a string ends with a given suffix. (from PHPUnit_Framework_Assert)
assertStringEqualsFile($expectedFile, $actualString, $message = "", $canonicalize = false, $ignoreCase = false)Asserts that the contents of a string is equal to the contents of a file. (from PHPUnit_Framework_Assert)
assertStringMatchesFormat($format, $string, $message = "")Asserts that a string matches a given format string. (from PHPUnit_Framework_Assert)
assertStringMatchesFormatFile($formatFile, $string, $message = "")Asserts that a string matches a given format file. (from PHPUnit_Framework_Assert)
assertStringNotEqualsFile($expectedFile, $actualString, $message = "", $canonicalize = false, $ignoreCase = false)Asserts that the contents of a string is not equal to the contents of a file. (from PHPUnit_Framework_Assert)
assertStringNotMatchesFormat($format, $string, $message = "")Asserts that a string does not match a given format string. (from PHPUnit_Framework_Assert)
assertStringNotMatchesFormatFile($formatFile, $string, $message = "")Asserts that a string does not match a given format string. (from PHPUnit_Framework_Assert)
assertStringStartsNotWith($prefix, $string, $message = "")Asserts that a string starts not with a given prefix. (from PHPUnit_Framework_Assert)
assertStringStartsWith($prefix, $string, $message = "")Asserts that a string starts with a given prefix. (from PHPUnit_Framework_Assert)
assertTag($matcher, $actual, $message = "", $isHtml = true)Evaluate an HTML or XML string and assert its structure and/or contents. (from PHPUnit_Framework_Assert)
assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = "")Evaluates a PHPUnit_Framework_Constraint matcher object. (from PHPUnit_Framework_Assert)
assertTrue($condition, $message = "")Asserts that a condition is true. (from PHPUnit_Framework_Assert)
assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = "")Asserts that two XML files are equal. (from PHPUnit_Framework_Assert)
assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = "")Asserts that two XML files are not equal. (from PHPUnit_Framework_Assert)
assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = "")Asserts that two XML documents are equal. (from PHPUnit_Framework_Assert)
assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = "")Asserts that two XML documents are equal. (from PHPUnit_Framework_Assert)
assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = "")Asserts that two XML documents are not equal. (from PHPUnit_Framework_Assert)
assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = "")Asserts that two XML documents are not equal. (from PHPUnit_Framework_Assert)
attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)Returns a PHPUnit_Framework_Constraint_Attribute matcher object. (from PHPUnit_Framework_Assert)
attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)Returns a PHPUnit_Framework_Constraint_IsEqual matcher object that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher object. (from PHPUnit_Framework_Assert)
callback($callback)Returns a PHPUnit_Framework_Constraint_Callback matcher object. (from PHPUnit_Framework_Assert)
classHasAttribute($attributeName)Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object. (from PHPUnit_Framework_Assert)
classHasStaticAttribute($attributeName)Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher object. (from PHPUnit_Framework_Assert)
contains($value, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)Returns a PHPUnit_Framework_Constraint_TraversableContains matcher object. (from PHPUnit_Framework_Assert)
containsOnly($type)Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher object. (from PHPUnit_Framework_Assert)
containsOnlyInstancesOf($classname)Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher object. (from PHPUnit_Framework_Assert)
countOf($count)Returns a PHPUnit_Framework_Constraint_Count matcher object. (from PHPUnit_Framework_Assert)
equalTo($value, $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)Returns a PHPUnit_Framework_Constraint_IsEqual matcher object. (from PHPUnit_Framework_Assert)
fail($message = "")Fails a test with the given message. (from PHPUnit_Framework_Assert)
fileExists()Returns a PHPUnit_Framework_Constraint_FileExists matcher object. (from PHPUnit_Framework_Assert)
getCount()Return the current assertion count. (from PHPUnit_Framework_Assert)
getObjectAttribute($object, $attributeName)Returns the value of an object's attribute. This also works for attributes that are declared protected or private. (from PHPUnit_Framework_Assert)
getStaticAttribute($className, $attributeName)Returns the value of a static attribute. This also works for attributes that are declared protected or private. (from PHPUnit_Framework_Assert)
greaterThan($value)Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object. (from PHPUnit_Framework_Assert)
greaterThanOrEqual($value)Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps a PHPUnit_Framework_Constraint_IsEqual and a PHPUnit_Framework_Constraint_GreaterThan matcher object. (from PHPUnit_Framework_Assert)
identicalTo($value)Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object. (from PHPUnit_Framework_Assert)
isEmpty()Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object. (from PHPUnit_Framework_Assert)
isFalse()Returns a PHPUnit_Framework_Constraint_IsFalse matcher object. (from PHPUnit_Framework_Assert)
isInstanceOf($className)Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object. (from PHPUnit_Framework_Assert)
isJson()Returns a PHPUnit_Framework_Constraint_IsJson matcher object. (from PHPUnit_Framework_Assert)
isNull()Returns a PHPUnit_Framework_Constraint_IsNull matcher object. (from PHPUnit_Framework_Assert)
isTrue()Returns a PHPUnit_Framework_Constraint_IsTrue matcher object. (from PHPUnit_Framework_Assert)
isType($type)Returns a PHPUnit_Framework_Constraint_IsType matcher object. (from PHPUnit_Framework_Assert)
lessThan($value)Returns a PHPUnit_Framework_Constraint_LessThan matcher object. (from PHPUnit_Framework_Assert)
lessThanOrEqual($value)Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps a PHPUnit_Framework_Constraint_IsEqual and a PHPUnit_Framework_Constraint_LessThan matcher object. (from PHPUnit_Framework_Assert)
logicalAnd()Returns a PHPUnit_Framework_Constraint_And matcher object. (from PHPUnit_Framework_Assert)
logicalNot(PHPUnit_Framework_Constraint $constraint)Returns a PHPUnit_Framework_Constraint_Not matcher object. (from PHPUnit_Framework_Assert)
logicalOr()Returns a PHPUnit_Framework_Constraint_Or matcher object. (from PHPUnit_Framework_Assert)
logicalXor()Returns a PHPUnit_Framework_Constraint_Xor matcher object. (from PHPUnit_Framework_Assert)
markTestIncomplete($message = "")Mark the test as incomplete. (from PHPUnit_Framework_Assert)
markTestSkipped($message = "")Mark the test as skipped. (from PHPUnit_Framework_Assert)
matches($string)Returns a PHPUnit_Framework_Constraint_StringMatches matcher object. (from PHPUnit_Framework_Assert)
matchesRegularExpression($pattern)Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object. (from PHPUnit_Framework_Assert)
objectHasAttribute($attributeName)Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object. (from PHPUnit_Framework_Assert)
readAttribute($classOrObject, $attributeName)Returns the value of an attribute of a class or an object. This also works for attributes that are declared protected or private. (from PHPUnit_Framework_Assert)
resetCount()Reset the assertion counter. (from PHPUnit_Framework_Assert)
stringContains($string, $case = true)Returns a PHPUnit_Framework_Constraint_StringContains matcher object. (from PHPUnit_Framework_Assert)
stringEndsWith($suffix)Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object. (from PHPUnit_Framework_Assert)
stringStartsWith($prefix)Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object. (from PHPUnit_Framework_Assert)

public function __construct(PHPUnit_Framework_Test $test)

Constructor.

Parameters:
PHPUnit_Framework_Test - $test

public function basicRun(PHPUnit_Framework_TestResult $result)

Runs the test and collects the result in a TestResult.

Parameters:
PHPUnit_Framework_TestResult - $result

public function count()

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

Returns:
integer

protected function createResult()

Creates a default TestResult object.

Returns:
PHPUnit_Framework_TestResult

public function getTest()

Returns the test to be run.

Returns:
PHPUnit_Framework_Test

public function run(PHPUnit_Framework_TestResult $result = null)

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

Parameters:
PHPUnit_Framework_TestResult - $result
Defaults:
result = null
Returns:
PHPUnit_Framework_TestResult

public function toString()

Returns a string representation of the test.

Returns:
string