Viewing File server/test/phpunit.php of 1.19.2a
|
%s\n--------\n%s", 85: $htmlExpected, $htmlActual); 86: $this->fail($str); 87: } 88: } 89: 90: class TestCase extends Assert /* implements Test */ { 91: /* Defines context for running tests. Specific context -- such as 92: instance variables, global variables, global state -- is defined 93: by creating a subclass that specializes the setUp() and 94: tearDown() methods. A specific test is defined by a subclass 95: that specializes the runTest() method. */ 96: var $fName; 97: var $fResult; 98: var $fExceptions = array(); 99: 100: function TestCase($name) { 101: $this->fName = $name; 102: } 103: 104: function run($testResult=0) { 105: /* Run this single test, by calling the run() method of the 106: TestResult object which will in turn call the runBare() method 107: of this object. That complication allows the TestResult object 108: to do various kinds of progress reporting as it invokes each 109: test. Create/obtain a TestResult object if none was passed in. 110: Note that if a TestResult object was passed in, it must be by 111: reference. */ 112: if (! $testResult) 113: $testResult = $this->_createResult(); 114: $this->fResult = $testResult; 115: $testResult->run(&$this); 116: $this->fResult = 0; 117: return $testResult; 118: } 119: 120: function countTestCases() { 121: return 1; 122: } 123: 124: function runTest() { 125: $name = $this->name(); 126: // Since isset($this->$name) is false, no way to run defensive checks 127: $this->$name(); 128: } 129: 130: function setUp() /* expect override */ { 131: //print("TestCase::setUp()
%s test%s run
", $nRun, ($nRun == 1) ? '' : 's');