Creates an empty test case. Should be subclassed with test methods for a functional test case.
UnitTestCase
UnitTestCase
([string $label = false])
-
string
$label: Name of test case. Will use the class name if none specified.
Will trigger a pass if both parameters refer to different objects. Fail otherwise. The objects have to be identical though.
boolean
assertClone
( &$first, &$second, [string $message = '%s'], mixed $first, mixed $second)
-
mixed
$first: Object reference to check.
-
mixed
$second: Hopefully not the same object.
-
string
$message: Message to display.
-
&$first
-
&$second
void
assertCopy
( &$first, &$second, [ $message = "%s"])
-
&$first
-
&$second
-
$message
Will trigger a pass if the two parameters have the same value only. Otherwise a fail.
boolean
assertEqual
(mixed $first, mixed $second, [string $message = '%s'])
-
mixed
$first: Value to compare.
-
mixed
$second: Value to compare.
-
string
$message: Message to display.
void
assertError
([ $expected = false], [ $message = '%s'])
void
assertErrorPattern
( $pattern, [ $message = '%s'])
Will be true on false and vice versa. False is the PHP definition of false, so that null, empty strings, zero and an empty array all count as false.
boolean
assertFalse
(boolean $result, [string $message = '%s'])
-
boolean
$result: Pass on false.
-
string
$message: Message to display.
Will trigger a pass if the two parameters have the same value and same type. Otherwise a fail.
boolean
assertIdentical
(mixed $first, mixed $second, [string $message = '%s'])
-
mixed
$first: Value to compare.
-
mixed
$second: Value to compare.
-
string
$message: Message to display.
Type and class test. Will pass if class matches the type name or is a subclass or if not an object, but the type is correct.
boolean
assertIsA
(mixed $object, string $type, [string $message = '%s'])
-
mixed
$object: Object to test.
-
string
$type: Type name as string.
-
string
$message: Message to display.
void
assertNoErrors
([ $message = '%s'])
Will trigger a pass if the perl regex pattern is not present in subject. Fail if found.
boolean
assertNoPattern
(string $pattern, string $subject, [string $message = '%s'])
-
string
$pattern: Perl regex to look for including the regex delimiters.
-
string
$subject: String to search in.
-
string
$message: Message to display.
Type and class mismatch test. Will pass if class name or underling type does not match the one specified.
boolean
assertNotA
(mixed $object, string $type, [string $message = '%s'])
-
mixed
$object: Object to test.
-
string
$type: Type name as string.
-
string
$message: Message to display.
Will trigger a pass if the two parameters have a different value. Otherwise a fail.
boolean
assertNotEqual
(mixed $first, mixed $second, [string $message = '%s'])
-
mixed
$first: Value to compare.
-
mixed
$second: Value to compare.
-
string
$message: Message to display.
Will trigger a pass if the two parameters have the different value or different type.
boolean
assertNotIdentical
(mixed $first, mixed $second, [string $message = '%s'])
-
mixed
$first: Value to compare.
-
mixed
$second: Value to compare.
-
string
$message: Message to display.
Will be true if the value is set.
boolean
assertNotNull
(mixed $value, [string $message = '%s'])
-
mixed
$value: Supposedly set value.
-
string
$message: Message to display.
void
assertNoUnwantedPattern
( $pattern, $subject, [ $message = '%s'])
-
$pattern
-
$subject
-
$message
Will be true if the value is null.
boolean
assertNull
(null $value, [string $message = '%s'])
-
null
$value: Supposedly null value.
-
string
$message: Message to display.
Will trigger a pass if the two parameters differ by more than the margin.
boolean
assertOutsideMargin
(mixed $first, mixed $second, mixed $margin, [string $message = '%s'])
-
mixed
$first: Value to compare.
-
mixed
$second: Value to compare.
-
mixed
$margin: Fuzziness of match.
-
string
$message: Message to display.
Will trigger a pass if the Perl regex pattern is found in the subject. Fail otherwise.
boolean
assertPattern
(string $pattern, string $subject, [string $message = '%s'])
-
string
$pattern: Perl regex to look for including the regex delimiters.
-
string
$subject: String to search in.
-
string
$message: Message to display.
Will trigger a pass if both parameters refer to the same object. Fail otherwise.
boolean
assertReference
( &$first, &$second, [string $message = '%s'], mixed $first, mixed $second)
-
mixed
$first: Object reference to check.
-
mixed
$second: Hopefully the same object.
-
string
$message: Message to display.
-
&$first
-
&$second
Called from within the test methods to register passes and failures.
boolean
assertTrue
(boolean $result, [string $message = false])
-
boolean
$result: Pass on true.
-
string
$message: Message to display describing the test state.
void
assertWantedPattern
( $pattern, $subject, [ $message = '%s'])
-
$pattern
-
$subject
-
$message
Will trigger a pass if the if the first parameter is near enough to the second by the margin.
boolean
assertWithinMargin
(mixed $first, mixed $second, mixed $margin, [string $message = '%s'])
-
mixed
$first: Value to compare.
-
mixed
$second: Value to compare.
-
mixed
$margin: Fuzziness of match.
-
string
$message: Message to display.
Prepares for an error. If the error mismatches it passes through, otherwise it is swallowed. Any left over errors trigger failures.
void
expectError
([SimpleExpectation/string $expected = false], [string $message = '%s'])
-
SimpleExpectation/string
$expected: The error to match.
-
string
$message: Message on failure.
Prepares for an exception. If the error mismatches it passes through, otherwise it is swallowed. Any left over errors trigger failures.
void
expectException
([SimpleExpectation/Exception $expected = false], [string $message = '%s'])
-
SimpleExpectation/Exception
$expected: The error to match.
-
string
$message: Message on failure.
Inherited Methods
Inherited From SimpleTestCase
SimpleTestCase::SimpleTestCase()
SimpleTestCase::after()
SimpleTestCase::assert()
SimpleTestCase::assertExpectation()
SimpleTestCase::before()
SimpleTestCase::createInvoker()
SimpleTestCase::dump()
SimpleTestCase::error()
SimpleTestCase::exception()
SimpleTestCase::fail()
SimpleTestCase::getAssertionLine()
SimpleTestCase::getLabel()
SimpleTestCase::getSize()
SimpleTestCase::getTests()
SimpleTestCase::pass()
SimpleTestCase::run()
SimpleTestCase::sendMessage()
SimpleTestCase::setUp()
SimpleTestCase::signal()
SimpleTestCase::skip()
SimpleTestCase::skipIf()
SimpleTestCase::skipUnless()
SimpleTestCase::tearDown()
SimpleTestCase::tell()
SimpleTestCase::_isTest()