SimpleTestCase
└─UnitTestCase
public class UnitTestCase
extends SimpleTestCase
Constructor Summary | |
---|---|
UnitTestCase(string label) Creates an empty test case. |
Method Summary | |
---|---|
boolean | assertCopy(mixed first, mixed second, string message) Will trigger a pass if both parameters refer to different objects. |
boolean | assertEqual(mixed first, mixed second, string message) Will trigger a pass if the two parameters have the same value only. |
boolean | assertError(string expected, string message) Confirms that an error has occoured and optionally that the error text matches exactly. |
boolean | assertErrorPattern(string pattern, string message) Confirms that an error has occoured and that the error text matches a Perl regular expression. |
boolean | assertIdentical(mixed first, mixed second, string message) Will trigger a pass if the two parameters have the same value and same type. |
boolean | assertIsA(mixed object, string type, string message) Type and class test. |
boolean | assertNoErrors(string message) Confirms that no errors have occoured so far in the test method. |
boolean | assertNoUnwantedPattern(string pattern, string subject, string message) Will trigger a pass if the perl regex pattern is not present in subject. |
boolean | assertNotA(mixed object, string type, string message) Type and class mismatch test. |
boolean | assertNotEqual(mixed first, mixed second, string message) Will trigger a pass if the two parameters have a different value. |
boolean | assertNotIdentical(mixed first, mixed second, string message) Will trigger a pass if the two parameters have the different value or different type. |
boolean | assertNotNull(mixed value, string message) Will be true if the value is set. |
boolean | assertNull(null value, string message) Will be true if the value is null. |
boolean | assertReference(mixed first, mixed second, string message) Will trigger a pass if both parameters refer to the same object. |
boolean | assertWantedPattern(string pattern, string subject, string message) Will trigger a pass if the Perl regex pattern is found in the subject. |
Methods inherited from SimpleTest\SimpleTestCase | |
---|---|
assertExpectation, assertFalse, assertTrue, createInvoker, dump, error, fail, getAssertionLine, getLabel, getSize, pass, run, sendMessage, setUp, signal, swallowErrors, tearDown |
public UnitTestCase(string label)
Creates an empty test case. Should be subclassed with test methods for a functional test case.
public boolean assertCopy(mixed first, mixed second, string message)
Will trigger a pass if both parameters refer to different objects. Fail otherwise.
public boolean assertEqual(mixed first, mixed second, string message)
Will trigger a pass if the two parameters have the same value only. Otherwise a fail.
public boolean assertError(string expected, string message)
Confirms that an error has occoured and optionally that the error text matches exactly.
public boolean assertErrorPattern(string pattern, string message)
Confirms that an error has occoured and that the error text matches a Perl regular expression.
public boolean assertIdentical(mixed first, mixed second, string message)
Will trigger a pass if the two parameters have the same value and same type. Otherwise a fail.
public boolean assertIsA(mixed object, string type, string message)
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.
public boolean assertNoErrors(string message)
Confirms that no errors have occoured so far in the test method.
public boolean assertNoUnwantedPattern(string pattern, string subject, string message)
Will trigger a pass if the perl regex pattern is not present in subject. Fail if found.
public boolean assertNotA(mixed object, string type, string message)
Type and class mismatch test. Will pass if class name or underling type does not match the one specified.
public boolean assertNotEqual(mixed first, mixed second, string message)
Will trigger a pass if the two parameters have a different value. Otherwise a fail.
public boolean assertNotIdentical(mixed first, mixed second, string message)
Will trigger a pass if the two parameters have the different value or different type.
public boolean assertNotNull(mixed value, string message)
Will be true if the value is set.
public boolean assertNull(null value, string message)
Will be true if the value is null.
public boolean assertReference(mixed first, mixed second, string message)
Will trigger a pass if both parameters refer to the same object. Fail otherwise.
public boolean assertWantedPattern(string pattern, string subject, string message)
Will trigger a pass if the Perl regex pattern is found in the subject. Fail otherwise.
Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.