Commit 574ebdbf authored by webchick's avatar webchick

Issue #2206417 by sun: Bogus tests without test methods are reported as successful tests.

parent 7a228368
...@@ -806,6 +806,11 @@ public function run(array $methods = array()) { ...@@ -806,6 +806,11 @@ public function run(array $methods = array()) {
$test_methods = array_filter(get_class_methods($class), function ($method) { $test_methods = array_filter(get_class_methods($class), function ($method) {
return strpos($method, 'test') === 0; return strpos($method, 'test') === 0;
}); });
if (empty($test_methods)) {
// Call $this->assert() here because we need to pass along custom caller
// information, lest the wrong originating code file/line be identified.
$this->assert(FALSE, 'No test methods found.', 'Requirements', array('function' => __METHOD__ . '()', 'file' => __FILE__, 'line' => __LINE__));
}
if ($methods) { if ($methods) {
$test_methods = array_intersect($test_methods, $methods); $test_methods = array_intersect($test_methods, $methods);
} }
......
...@@ -59,4 +59,12 @@ protected function setUpConfirm() { ...@@ -59,4 +59,12 @@ protected function setUpConfirm() {
parent::setUpConfirm(); parent::setUpConfirm();
} }
/**
* Verifies that installation succeeded.
*/
public function testInstaller() {
$this->assertUrl('user/1');
$this->assertResponse(200);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment