Source for file pear_test_case.php
Documentation is available at pear_test_case.php
* adapter for SimpleTest to use PEAR PHPUnit test cases
* @version $Id: pear_test_case.php 1388 2006-11-10 20:59:59Z lastcraft $
* include SimpleTest files
require_once(dirname(__FILE__
) .
'/../dumper.php');
require_once(dirname(__FILE__
) .
'/../compatibility.php');
require_once(dirname(__FILE__
) .
'/../test_case.php');
require_once(dirname(__FILE__
) .
'/../expectation.php');
* Adapter for PEAR PHPUnit test case to allow
* legacy PEAR test cases to be used with SimpleTest.
* Constructor. Sets the test name.
* @param $label Test name to display.
* Will test straight equality if set to loose
* typing, or identity if not.
* @param $first First value.
* @param $second Comparison value.
* @param $message Message to display.
function assertEquals($first, $second, $message =
"%s", $delta =
0) {
$this->assert($expectation, $second, $message);
* Passes if the value tested is not null.
* @param $value Value to test against.
* @param $message Message to display.
* Passes if the value tested is null.
* @param $value Value to test against.
* @param $message Message to display.
* In PHP5 the identity test tests for the same
* object. This is a reference test in PHP4.
* @param $first First object handle.
* @param $second Hopefully the same handle.
* @param $message Message to display.
function assertSame(&$first, &$second, $message =
"%s") {
"[" .
$dumper->describeValue($first) .
"] and [" .
$dumper->describeValue($second) .
"] should reference the same object");
* In PHP5 the identity test tests for the same
* object. This is a reference test in PHP4.
* @param $first First object handle.
* @param $second Hopefully a different handle.
* @param $message Message to display.
"[" .
$dumper->describeValue($first) .
"] and [" .
$dumper->describeValue($second) .
"] should not be the same object");
* Sends pass if the test condition resolves true,
* @param $condition Condition to test true.
* @param $message Message to display.
function assertTrue($condition, $message =
"%s") {
* Sends pass if the test condition resolves false,
* @param $condition Condition to test false.
* @param $message Message to display.
* Tests a regex match. Needs refactoring.
* @param $pattern Regex to match.
* @param $subject String to search in.
* @param $message Message to display.
function assertRegExp($pattern, $subject, $message =
"%s") {
* Tests the type of a value.
* @param $value Value to take type of.
* @param $type Hoped for type.
* @param $message Message to display.
function assertType($value, $type, $message =
"%s") {
* Sets equality operation to act as a simple equal
* comparison only, allowing a broader range of
* @param $loosely_typed True for broader comparison.
* For progress indication during
* a test amongst other things.
* Accessor for name, normally just the class
* Does nothing. For compatibility only.
Documentation generated on Sun, 04 May 2008 09:21:56 -0500 by phpDocumentor 1.3.0