mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Copying request params before Core.php exec in PHPUnit bootstrap
Same behaviour as with 3.0 bootstrap.php and the 2.4 cli-script.php (which it is based on). This allows to use GET switches which are evaluated in _config.php files, e.g. db=<db-alias> settings for running tests with various DBs without changing the underlying PHP config.
This commit is contained in:
parent
3fad49e2c0
commit
44c41085b9
@ -19,8 +19,6 @@ function silverstripe_test_autoload($className) {
|
||||
}
|
||||
spl_autoload_register('silverstripe_test_autoload');
|
||||
|
||||
require_once(getcwd()."/sapphire/core/Core.php");
|
||||
|
||||
// Copied from cli-script.php, to enable same behaviour through phpunit runner.
|
||||
if(isset($_SERVER['argv'][2])) {
|
||||
$args = array_slice($_SERVER['argv'],2);
|
||||
@ -37,6 +35,8 @@ if(isset($_SERVER['argv'][2])) {
|
||||
$_REQUEST = $_GET;
|
||||
}
|
||||
|
||||
require_once(getcwd()."/sapphire/core/Core.php");
|
||||
|
||||
// Now set a fake REQUEST_URI
|
||||
$_SERVER['REQUEST_URI'] = BASE_URL . '/dev/tests/all';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user