mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX: Throw more helpful error if tests are run badly.
If you run tests outside of a composer autoloader-based environment, or your autoloader isn’t pulling in Constants.php, everything will break. This provides a more helpful error message.
This commit is contained in:
parent
3ea23ce2b7
commit
2e054af7b1
@ -3,6 +3,13 @@
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
|
||||
if(!defined('BASE_PATH')) {
|
||||
echo "BASE_PATH hasn't been defined. This probably means that framework/Core/Constants.php hasn't been " .
|
||||
"included by Composer's autoloader.\n" .
|
||||
"Make sure the you are running your tests via vendor/bin/phpunit and your autoloader is up to date.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This bootstraps the SilverStripe system so that phpunit can be run directly on SilverStripe tests.
|
||||
|
Loading…
x
Reference in New Issue
Block a user