ENHANCEMENT Improved error message on invalid classname for TestRunner

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64012 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-10-09 18:43:22 +00:00
parent 757e0ed755
commit ad3f0f400f

View File

@ -111,6 +111,9 @@ 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)) {
$this->runTests(array($className));
} else {