),
'line(s)' => array('line', 'lines'),
+
+ '%d assertion(s) passed.' => array(
+ '%d assertion passed.',
+ '%d assertions passed.',
+ ),
));
phutil_load_library(dirname(dirname(__FILE__)).'/src/');
*/
abstract class ArcanistPhutilTestCase {
+ private $assertions = 0;
private $runningTest;
private $testStartTime;
private $results = array();
*/
final protected function assertEqual($expect, $result, $message = null) {
if ($expect === $result) {
+ $this->assertions++;
return;
}
$name = $method->getName();
if (preg_match('/^test/', $name)) {
$this->runningTest = $name;
+ $this->assertions = 0;
$this->testStartTime = microtime(true);
try {
call_user_func_array(
array($this, $name),
array());
- $this->passTest("All assertions passed.");
+ $this->passTest(pht('%d assertion(s) passed.', $this->assertions));
} catch (Exception $ex) {
$test_exception = $ex;
}