Removed 'base_path' from AkInstaller->setInstalledVersion because Ak:make_dir can...
[akelos.git] / vendor / simpletest / extensions / phpunit_test_case.php
blob3fd8441f9fcfaec16421ef2ebbcf0323b4f77469
1 <?php
2 /**
3 * adapter for SimpleTest to use PHPUnit test cases
4 * @package SimpleTest
5 * @subpackage Extensions
6 * @version $Id: phpunit_test_case.php,v 1.6 2006/01/03 01:17:08 lastcraft Exp $
7 */
9 /**#@+
10 * include SimpleTest files
12 require_once(dirname(__FILE__) . '/../unit_tester.php');
13 require_once(dirname(__FILE__) . '/../expectation.php');
14 /**#@-*/
16 /**
17 * Adapter for sourceforge PHPUnit test case to allow
18 * legacy test cases to be used with SimpleTest.
19 * @package SimpleTest
20 * @subpackage Extensions
22 class TestCase extends SimpleTestCase {
24 /**
25 * Constructor. Sets the test name.
26 * @param $label Test name to display.
27 * @public
29 function TestCase($label) {
30 $this->SimpleTestCase($label);
33 /**
34 * Sends pass if the test condition resolves true,
35 * a fail otherwise.
36 * @param $condition Condition to test true.
37 * @param $message Message to display.
38 * @public
40 function assert($condition, $message = false) {
41 parent::assertTrue($condition, $message);
44 /**
45 * Will test straight equality if set to loose
46 * typing, or identity if not.
47 * @param $first First value.
48 * @param $second Comparison value.
49 * @param $message Message to display.
50 * @public
52 function assertEquals($first, $second, $message = false) {
53 parent::assert(new EqualExpectation($first), $second, $message);
56 /**
57 * Simple string equality.
58 * @param $first First value.
59 * @param $second Comparison value.
60 * @param $message Message to display.
61 * @public
63 function assertEqualsMultilineStrings($first, $second, $message = false) {
64 parent::assert(new EqualExpectation($first), $second, $message);
67 /**
68 * Tests a regex match.
69 * @param $pattern Regex to match.
70 * @param $subject String to search in.
71 * @param $message Message to display.
72 * @public
74 function assertRegexp($pattern, $subject, $message = false) {
75 parent::assert(new PatternExpectation($pattern), $subject, $message);
78 /**
79 * Sends an error which we interpret as a fail
80 * with a different message for compatibility.
81 * @param $message Message to display.
82 * @public
84 function error($message) {
85 parent::fail("Error triggered [$message]");
88 /**
89 * Accessor for name.
90 * @public
92 function name() {
93 return $this->getLabel();