mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #2057 from jthomerson/enhancement_3.1_do_not_run_abstract_test_cases
ENHANCEMENT: Do not attempt to run abstract test classes
This commit is contained in:
commit
4ebd5ab740
@ -286,8 +286,18 @@ class TestRunner extends Controller {
|
||||
$skipTests = explode(',', $this->request->getVar('SkipTests'));
|
||||
}
|
||||
|
||||
$classList = array_diff($classList, $skipTests);
|
||||
$abstractClasses = array();
|
||||
foreach($classList as $className) {
|
||||
// Ensure that the autoloader pulls in the test class, as PHPUnit won't know how to do this.
|
||||
class_exists($className);
|
||||
$reflection = new ReflectionClass($className);
|
||||
if ($reflection->isAbstract()) {
|
||||
array_push($abstractClasses, $className);
|
||||
}
|
||||
}
|
||||
|
||||
$classList = array_diff($classList, $skipTests, $abstractClasses);
|
||||
|
||||
// run tests before outputting anything to the client
|
||||
$suite = new PHPUnit_Framework_TestSuite();
|
||||
natcasesort($classList);
|
||||
|
Loading…
x
Reference in New Issue
Block a user