mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Limited error message scope on invalid classname for TestRunner
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64013 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ad3f0f400f
commit
9a298e1592
@ -111,10 +111,10 @@ class TestRunner extends Controller {
|
|||||||
*/
|
*/
|
||||||
function only($request) {
|
function only($request) {
|
||||||
$className = $request->param('TestCase');
|
$className = $request->param('TestCase');
|
||||||
if(!$className || !ClassInfo::exists($className) || !(singleton($className) instanceof SapphireTest)) {
|
if(class_exists($className)) {
|
||||||
|
if(!(singleton($className) instanceof SapphireTest)) {
|
||||||
user_error("TestRunner::only(): Invalid TestCase '$className', cannot find matching class", E_USER_ERROR);
|
user_error("TestRunner::only(): Invalid TestCase '$className', cannot find matching class", E_USER_ERROR);
|
||||||
}
|
}
|
||||||
if(class_exists($className)) {
|
|
||||||
$this->runTests(array($className));
|
$this->runTests(array($className));
|
||||||
} else {
|
} else {
|
||||||
if ($className == 'all') $this->all();
|
if ($className == 'all') $this->all();
|
||||||
@ -219,6 +219,7 @@ HTML;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$dbname = SapphireTest::create_temp_db();
|
$dbname = SapphireTest::create_temp_db();
|
||||||
|
|
||||||
DB::set_alternative_database_name($dbname);
|
DB::set_alternative_database_name($dbname);
|
||||||
|
|
||||||
$fixture = new YamlFixture($_GET['fixture']);
|
$fixture = new YamlFixture($_GET['fixture']);
|
||||||
|
Loading…
Reference in New Issue
Block a user