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:
Ingo Schommer 2008-10-09 18:49:24 +00:00
parent ad3f0f400f
commit 9a298e1592

View File

@ -111,10 +111,10 @@ class TestRunner extends Controller {
*/
function only($request) {
$className = $request->param('TestCase');
if(!$className || !ClassInfo::exists($className) || !(singleton($className) instanceof SapphireTest)) {
user_error("TestRunner::only(): Invalid TestCase '$className', cannot find matching class", E_USER_ERROR);
}
if(class_exists($className)) {
if(!(singleton($className) instanceof SapphireTest)) {
user_error("TestRunner::only(): Invalid TestCase '$className', cannot find matching class", E_USER_ERROR);
}
$this->runTests(array($className));
} else {
if ($className == 'all') $this->all();
@ -219,6 +219,7 @@ HTML;
}
$dbname = SapphireTest::create_temp_db();
DB::set_alternative_database_name($dbname);
$fixture = new YamlFixture($_GET['fixture']);