got console stuff working, fixed a bunch of typos/syntax errors/logic issues

This commit is contained in:
tmont 2009-06-13 08:24:06 +00:00
parent c44ccb62b3
commit aa4300375e
8 changed files with 26 additions and 6 deletions

View File

@ -18,6 +18,10 @@
return true;
}
public function count() {
return 1;
}
}
?>

View File

@ -18,6 +18,10 @@
return true;
}
public function count() {
return 1;
}
}
?>

View File

@ -18,6 +18,10 @@
return false;
}
public function count() {
return 1;
}
}
?>

View File

@ -16,6 +16,10 @@
return false;
}
public function count() {
return 1;
}
}
?>

View File

@ -18,7 +18,7 @@
public function run(array $listeners) {
foreach ($listeners as $listener) {
$listener->onBeforeTestCase($this);
$listener->beforeTestCase($this);
}
$result = new CombinedTestResult();
@ -28,7 +28,7 @@
}
foreach ($listeners as $listener) {
$listener->onAfterTestCase($this);
$listener->afterTestCase($this);
}
return $result;
@ -38,7 +38,7 @@
$refClass = new ReflectionClass($this);
$methods = array();
foreach ($refClass->getMethods() as $method) {
if (preg_match('/^[\*\s]*@test\s*$/m', $method->getDocBlock())) {
if (preg_match('/^[\*\s]*@test\s*$/m', $method->getDocComment())) {
$methods[] = $method;
}
}

View File

@ -23,6 +23,9 @@
try {
$this->method->invoke($this->testCase);
$testPassed = true;
foreach ($listeners as $listener) {
$listener->onTestMethodPassed($this);
}
} catch (TestFailure $failure) {
$this->handleTestFailure($failure);
} catch (Exception $e) {
@ -32,7 +35,7 @@
}
}
$result = $this->createTestResult($this, $failure);
$result = $this->createTestResult($failure);
$this->testCase->tearDown();
foreach ($listeners as $listener) {

View File

@ -17,6 +17,7 @@
);
$last = null;
$switch = null;
foreach ($args as $arg) {
if (strpos($arg, '-') === 0) {
$last = (substr($arg, 0, 2) === '--') ? substr($arg, 2) : substr($arg, 1);

View File

@ -22,7 +22,7 @@
$testClass = new $testClass($testClass);
if ($testClass instanceof Testable) {
$tests[] = $testClasse;
$tests[] = $testClass;
}
} else if (is_dir($arg)) {
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($arg)) as $file) {
@ -36,7 +36,7 @@
$testClass = new $testClass($testClass);
if ($testClass instanceof Testable) {
$tests[] = $testClasse;
$tests[] = $testClass;
}
}
}