Public Member Functions | |
UnitTestCase ($label=false) | |
assertTrue ($result, $message=FALSE, $group= 'Other') | |
assertFalse ($result, $message= '%s', $group= 'Other') | |
assertNull ($value, $message= '%s', $group= 'Other') | |
assertNotNull ($value, $message= '%s', $group= 'Other') | |
assertEqual ($first, $second, $message= '%s', $group= 'Other') | |
assertNotEqual ($first, $second, $message= '%s', $group= 'Other') | |
assertIdentical ($first, $second, $message= '%s', $group= 'Other') | |
assertNotIdentical ($first, $second, $message= '%s', $group= 'Other') | |
assertPattern ($pattern, $subject, $message= '%s', $group= 'Other') | |
assertNoPattern ($pattern, $subject, $message= '%s', $group= 'Other') |
Definition at line 9 of file unit_tester.php.
UnitTestCase::UnitTestCase | ( | $ | label = false |
) |
Creates an empty test case. Should be subclassed with test methods for a functional test case.
string | $label Name of test case. Will use the class name if none specified. public |
Definition at line 18 of file unit_tester.php.
References SimpleTestCase::SimpleTestCase().
UnitTestCase::assertTrue | ( | $ | result, | |
$ | message = FALSE , |
|||
$ | group = 'Other' | |||
) |
Called from within the test methods to register passes and failures.
boolean | $result Pass on true. | |
string | $message Message to display describing the test state. |
Definition at line 34 of file unit_tester.php.
References $result, and SimpleTestCase::assert().
Referenced by DrupalWebTestCase::_drupalCreateRole(), assertEqual(), assertFalse(), DrupalWebTestCase::assertFieldByXPath(), assertIdentical(), DrupalWebTestCase::assertNoRaw(), assertNotEqual(), assertNotIdentical(), assertNotNull(), assertNull(), assertPattern(), DrupalWebTestCase::assertPattern(), DrupalWebTestCase::assertResponse(), DrupalWebTestCase::assertTextHelper(), DrupalWebTestCase::assertTitle(), DrupalWebTestCase::clickLink(), DrupalWebTestCase::curlExec(), DrupalWebTestCase::drupalCreateUser(), DrupalWebTestCase::drupalModuleDisable(), DrupalWebTestCase::drupalModuleEnable(), DrupalWebTestCase::drupalPost(), and DrupalWebTestCase::parse().
UnitTestCase::assertFalse | ( | $ | result, | |
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
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 | $result Pass on false. | |
string | $message Message to display. |
Definition at line 48 of file unit_tester.php.
References $result, and assertTrue().
Referenced by DrupalWebTestCase::assertNoFieldByXPath(), assertNoPattern(), DrupalWebTestCase::assertNoPattern(), and DrupalWebTestCase::assertRaw().
UnitTestCase::assertNull | ( | $ | value, | |
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
Will be true if the value is null.
null | $value Supposedly null value. | |
string | $message Message to display. |
Definition at line 61 of file unit_tester.php.
References $value, and assertTrue().
UnitTestCase::assertNotNull | ( | $ | value, | |
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
Will be true if the value is set.
mixed | $value Supposedly set value. | |
string | $message Message to display. |
Definition at line 74 of file unit_tester.php.
References $value, and assertTrue().
UnitTestCase::assertEqual | ( | $ | first, | |
$ | second, | |||
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
Will trigger a pass if the two parameters have the same value only. Otherwise a fail.
mixed | $first Value to compare. | |
mixed | $second Value to compare. | |
string | $message Message to display. |
Definition at line 89 of file unit_tester.php.
References assertTrue().
UnitTestCase::assertNotEqual | ( | $ | first, | |
$ | second, | |||
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
Will trigger a pass if the two parameters have a different value. Otherwise a fail.
mixed | $first Value to compare. | |
mixed | $second Value to compare. | |
string | $message Message to display. |
Definition at line 104 of file unit_tester.php.
References assertTrue().
UnitTestCase::assertIdentical | ( | $ | first, | |
$ | second, | |||
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
Will trigger a pass if the two parameters have the same value and same type. Otherwise a fail.
mixed | $first Value to compare. | |
mixed | $second Value to compare. | |
string | $message Message to display. |
Definition at line 119 of file unit_tester.php.
References assertTrue().
UnitTestCase::assertNotIdentical | ( | $ | first, | |
$ | second, | |||
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
Will trigger a pass if the two parameters have the different value or different type.
mixed | $first Value to compare. | |
mixed | $second Value to compare. | |
string | $message Message to display. |
Definition at line 134 of file unit_tester.php.
References assertTrue().
UnitTestCase::assertPattern | ( | $ | pattern, | |
$ | subject, | |||
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
Will trigger a pass if the Perl regex pattern is found in the subject. Fail otherwise.
string | $pattern Perl regex to look for including the regex delimiters. | |
string | $subject String to search in. | |
string | $message Message to display. |
Definition at line 150 of file unit_tester.php.
References assertTrue().
UnitTestCase::assertNoPattern | ( | $ | pattern, | |
$ | subject, | |||
$ | message = '%s' , |
|||
$ | group = 'Other' | |||
) |
Will trigger a pass if the perl regex pattern is not present in subject. Fail if found.
string | $pattern Perl regex to look for including the regex delimiters. | |
string | $subject String to search in. | |
string | $message Message to display. |
Definition at line 172 of file unit_tester.php.
References assertFalse().