WarningTestCase
class WarningTestCase extends TestCase (View source)
A warning.
Properties
protected bool | $backupGlobals | ||
protected array | $backupGlobalsBlacklist | from TestCase | |
protected bool | $backupStaticAttributes | ||
protected array | $backupStaticAttributesBlacklist | from TestCase | |
protected bool | $runTestInSeparateProcess | ||
protected bool | $preserveGlobalState | Whether or not this test should preserve the global state when running in a separate PHP process. | from TestCase |
protected string | $message | ||
protected bool | $useErrorHandler |
Methods
Asserts that an array has a specified key.
Asserts that an array has a specified subset.
Asserts that an array does not have a specified key.
Asserts that a haystack contains a needle.
Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object contains a needle.
Asserts that a haystack does not contain a needle.
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.
Asserts that a haystack contains only values of a given type.
Asserts that a haystack contains only instances of a given classname
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.
Asserts that a haystack does not contain only values of a given type.
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.
Asserts the number of elements of an array, Countable or Traversable.
Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute.
Asserts the number of elements of an array, Countable or Traversable.
Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute.
Asserts that two variables are equal.
Asserts that a variable is equal to an attribute of an object.
Asserts that two variables are not equal.
Asserts that a variable is not equal to an attribute of an object.
Asserts that a variable is empty.
Asserts that a static attribute of a class or an attribute of an object is empty.
Asserts that a variable is not empty.
Asserts that a static attribute of a class or an attribute of an object is not empty.
Asserts that a value is greater than another value.
Asserts that an attribute is greater than another value.
Asserts that a value is greater than or equal to another value.
Asserts that an attribute is greater than or equal to another value.
Asserts that a value is smaller than another value.
Asserts that an attribute is smaller than another value.
Asserts that a value is smaller than or equal to another value.
Asserts that an attribute is smaller than or equal to another value.
Asserts that the contents of one file is equal to the contents of another file.
Asserts that the contents of one file is not equal to the contents of another file.
Asserts that the contents of a string is equal to the contents of a file.
Asserts that the contents of a string is not equal to the contents of a file.
Asserts that a file/dir is readable.
Asserts that a file/dir exists and is not readable.
Asserts that a file/dir exists and is writable.
Asserts that a file/dir exists and is not writable.
Asserts that a directory exists.
Asserts that a directory does not exist.
Asserts that a directory exists and is readable.
Asserts that a directory exists and is not readable.
Asserts that a directory exists and is writable.
Asserts that a directory exists and is not writable.
Asserts that a file exists.
Asserts that a file does not exist.
Asserts that a file exists and is readable.
Asserts that a file exists and is not readable.
Asserts that a file exists and is writable.
Asserts that a file exists and is not writable.
Asserts that a condition is true.
Asserts that a condition is not true.
Asserts that a condition is false.
Asserts that a condition is not false.
Asserts that a variable is not null.
Asserts that a variable is finite.
Asserts that a variable is infinite.
Asserts that a class has a specified attribute.
Asserts that a class does not have a specified attribute.
Asserts that a class has a specified static attribute.
Asserts that a class does not have a specified static attribute.
Asserts that an object has a specified attribute.
Asserts that an object does not have a specified attribute.
Asserts that two variables have the same type and value.
Asserts that a variable and an attribute of an object have the same type and value.
Asserts that two variables do not have the same type and value.
Asserts that a variable and an attribute of an object do not have the same type and value.
Asserts that a variable is of a given type.
Asserts that an attribute is of a given type.
Asserts that a variable is not of a given type.
Asserts that an attribute is of a given type.
Asserts that a variable is of a given type.
Asserts that an attribute is of a given type.
Asserts that a variable is not of a given type.
Asserts that an attribute is of a given type.
Asserts that a string matches a given regular expression.
Asserts that a string does not match a given regular expression.
Assert that the size of two arrays (or Countable
or Traversable
objects)
is the same.
Assert that the size of two arrays (or Countable
or Traversable
objects)
is not the same.
Asserts that a string matches a given format string.
Asserts that a string does not match a given format string.
Asserts that a string matches a given format file.
Asserts that a string does not match a given format string.
Asserts that a string starts with a given prefix.
Asserts that a string starts not with a given prefix.
Asserts that a string ends with a given suffix.
Asserts that a string ends not with a given suffix.
Asserts that two XML files are equal.
Asserts that two XML files are not equal.
Asserts that two XML documents are equal.
Asserts that two XML documents are not equal.
Asserts that two XML documents are equal.
Asserts that two XML documents are not equal.
Asserts that a hierarchy of DOMElements matches.
Evaluates a PHPUnit\Framework\Constraint matcher object.
Asserts that a string is a valid JSON string.
Asserts that two given JSON encoded objects or arrays are equal.
Asserts that two given JSON encoded objects or arrays are not equal.
Asserts that the generated JSON encoded object and the content of the given file are equal.
Asserts that the generated JSON encoded object and the content of the given file are not equal.
Asserts that two JSON files are equal.
Asserts that two JSON files are not equal.
No description
No description
No description
No description
No description
Returns the value of an attribute of a class or an object.
Returns the value of a static attribute.
Returns the value of an object's attribute.
No description
Returns a string representation of the test case.
Sets up an expectation for an exception to be raised by the code under test.
No description
No description
Calling this method in setUp() has no effect!
No description
This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run.
This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.
Returns a builder object to create mock objects using a fluent interface.
Returns a test double for the specified class.
Returns a configured test double for the specified class.
Returns a partial test double for the specified class.
Returns a test proxy for the specified class.
Mocks the specified class and returns the name of the mocked class.
Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default.
Returns a mock object based on the given WSDL file.
Returns a mock object for the specified trait with all abstract methods
of the trait mocked. Concrete methods to mock can be specified with the
$mockedMethods
parameter.
Returns an object for the specified trait.
Returns a matcher that matches when the method is executed zero or more times.
Returns a matcher that matches when the method is never executed.
Returns a matcher that matches when the method is executed at least N times.
Returns a matcher that matches when the method is executed at least once.
Returns a matcher that matches when the method is executed exactly once.
Returns a matcher that matches when the method is executed exactly $count times.
Returns a matcher that matches when the method is executed at most N times.
Returns a matcher that matches when the method is executed at the given index.
No description
No description
No description
No description
Returns the current object.
No description
Gets the data set description of a TestCase.
This method is called before the first test of this test class is run.
This method is called after the last test of this test class is run.
This method is called when a test method did not execute successfully.
Performs custom preparations on the process isolation template.
No description
Details
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.
Used on objects, it asserts that two variables reference the same object.
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.
Used on objects, it asserts that two variables do not reference the same object.
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|DOMDocument $actualXml, string $message = '')
Asserts that two XML documents are equal.
static
assertXmlStringNotEqualsXmlFile(string $expectedFile, string|DOMDocument $actualXml, string $message = '')
Asserts that two XML documents are not equal.
static
assertXmlStringEqualsXmlString(string|DOMDocument $expectedXml, string|DOMDocument $actualXml, string $message = '')
Asserts that two XML documents are equal.
static
assertXmlStringNotEqualsXmlString(string|DOMDocument $expectedXml, string|DOMDocument $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, 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.
static LogicalAnd
logicalAnd()
static LogicalNot
logicalNot(Constraint $constraint)
static LogicalXor
logicalXor()
static IsAnything
anything()
static IsInfinite
isInfinite()
static Attribute
attribute(Constraint $constraint, string $attributeName)
static TraversableContains
contains(mixed $value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)
static TraversableContainsOnly
containsOnly(string $type)
static TraversableContainsOnly
containsOnlyInstancesOf(string $classname)
static ArrayHasKey
arrayHasKey(mixed $key)
static IsEqual
equalTo(mixed $value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)
static Attribute
attributeEqualTo(string $attributeName, mixed $value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false)
static IsWritable
isWritable()
static IsReadable
isReadable()
static DirectoryExists
directoryExists()
static FileExists
fileExists()
static GreaterThan
greaterThan(mixed $value)
static ClassHasAttribute
classHasAttribute(string $attributeName)
static ClassHasStaticAttribute
classHasStaticAttribute(string $attributeName)
static ObjectHasAttribute
objectHasAttribute(string $attributeName)
static IsIdentical
identicalTo(mixed $value)
static IsInstanceOf
isInstanceOf(string $className)
static RegularExpression
matchesRegularExpression(string $pattern)
static StringMatchesFormatDescription
matches(string $string)
static StringStartsWith
stringStartsWith(mixed $prefix)
static StringContains
stringContains(string $string, bool $case = true)
static StringEndsWith
stringEndsWith(mixed $suffix)
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.
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.
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.
at line 45
__construct(string $message = '')
at line 72
string
toString()
Returns a string representation of the test case.
int
count()
Counts the number of test cases executed by run(TestResult result).
expectExceptionObject(Exception $exception)
Sets up an expectation for an exception to be raised by the code under test.
Information for expected exception class, expected exception message, and expected exception code are retrieved from a given Exception object.
TestResult
run(TestResult $result = null)
Runs the test case and collects the results in a TestResult object.
If no TestResult object is passed a new one will be created.
at line 54
protected mixed
runTest()
setBeStrictAboutChangesToGlobalState(bool $beStrictAboutChangesToGlobalState)
setBackupGlobals(bool $backupGlobals)
Calling this method in setUp() has no effect!
setBackupStaticAttributes(bool $backupStaticAttributes)
Calling this method in setUp() has no effect!
TestResult
getTestResultObject()
setTestResultObject(TestResult $result)
protected
iniSet(string $varName, string $newValue)
This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run.
protected
setLocale()
This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.
PHPUnit_Framework_MockObject_MockBuilder
getMockBuilder(string|string[] $className)
Returns a builder object to create mock objects using a fluent interface.
protected PHPUnit_Framework_MockObject_MockObject
createMock(string $originalClassName)
Returns a test double for the specified class.
protected PHPUnit_Framework_MockObject_MockObject
createConfiguredMock(string $originalClassName, array $configuration)
Returns a configured test double for the specified class.
protected PHPUnit_Framework_MockObject_MockObject
createPartialMock(string $originalClassName, array $methods)
Returns a partial test double for the specified class.
protected PHPUnit_Framework_MockObject_MockObject
createTestProxy(string $originalClassName, array $constructorArguments = [])
Returns a test proxy for the specified class.
protected string
getMockClass(string $originalClassName, array $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = false, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = false)
Mocks the specified class and returns the name of the mocked class.
protected PHPUnit_Framework_MockObject_MockObject
getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false)
Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default.
To mock concrete methods, use the 7th parameter ($mockedMethods).
protected PHPUnit_Framework_MockObject_MockObject
getMockFromWsdl(string $wsdlFile, string $originalClassName = '', string $mockClassName = '', array $methods = [], bool $callOriginalConstructor = true, array $options = [])
Returns a mock object based on the given WSDL file.
protected PHPUnit_Framework_MockObject_MockObject
getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false)
Returns a mock object for the specified trait with all abstract methods
of the trait mocked. Concrete methods to mock can be specified with the
$mockedMethods
parameter.
protected object
getObjectForTrait(string $traitName, array $arguments = [], string $traitClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true)
Returns an object for the specified trait.
int
getNumAssertions()
Returns the number of assertions performed by this test.
static PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount
any()
Returns a matcher that matches when the method is executed zero or more times.
static PHPUnit_Framework_MockObject_Matcher_InvokedCount
never()
Returns a matcher that matches when the method is never executed.
static PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastCount
atLeast(int $requiredInvocations)
Returns a matcher that matches when the method is executed at least N times.
static PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
atLeastOnce()
Returns a matcher that matches when the method is executed at least once.
static PHPUnit_Framework_MockObject_Matcher_InvokedCount
once()
Returns a matcher that matches when the method is executed exactly once.
static PHPUnit_Framework_MockObject_Matcher_InvokedCount
exactly(int $count)
Returns a matcher that matches when the method is executed exactly $count times.
static PHPUnit_Framework_MockObject_Matcher_InvokedAtMostCount
atMost(int $allowedInvocations)
Returns a matcher that matches when the method is executed at most N times.
static PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
at(int $index)
Returns a matcher that matches when the method is executed at the given index.
static PHPUnit_Framework_MockObject_Stub_ReturnValueMap
returnValueMap(array $valueMap)
static PHPUnit_Framework_MockObject_Stub_ReturnArgument
returnArgument(int $argumentIndex)
static PHPUnit_Framework_MockObject_Stub_ReturnCallback
returnCallback(mixed $callback)
static PHPUnit_Framework_MockObject_Stub_ReturnSelf
returnSelf()
Returns the current object.
This method is useful when mocking a fluent interface.
static PHPUnit_Framework_MockObject_Stub_Exception
throwException(Throwable $exception)
static PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
onConsecutiveCalls()
string
getDataSetAsString(bool $includeData = true)
Gets the data set description of a TestCase.
protected TestResult
createResult()
Creates a default TestResult object.
static
setUpBeforeClass()
This method is called before the first test of this test class is run.
protected
setUp()
Sets up the fixture, for example, open a network connection.
This method is called before a test is executed.
protected
assertPreConditions()
Performs assertions shared by all tests of a test case.
This method is called before the execution of a test starts and after setUp() is called.
protected
assertPostConditions()
Performs assertions shared by all tests of a test case.
This method is called before the execution of a test ends and before tearDown() is called.
protected
tearDown()
Tears down the fixture, for example, close a network connection.
This method is called after a test is executed.
static
tearDownAfterClass()
This method is called after the last test of this test class is run.
protected
onNotSuccessfulTest(Throwable $t)
This method is called when a test method did not execute successfully.
protected
prepareTemplate(Text_Template $template)
Performs custom preparations on the process isolation template.