MDL-37324 fix phpunit and behat SESSION and USER setup

This commit is contained in:
Petr Škoda 2013-09-24 08:59:29 +02:00
parent c925e4fa8e
commit de230fd359
3 changed files with 14 additions and 8 deletions

View file

@ -765,8 +765,10 @@ if (empty($CFG->sessiontimeout)) {
$CFG->sessiontimeout = 7200;
}
\core\session\manager::start();
$SESSION = &$_SESSION['SESSION'];
$USER = &$_SESSION['USER'];
if (!PHPUNIT_TEST and !defined('BEHAT_TEST')) {
$SESSION =& $_SESSION['SESSION'];
$USER =& $_SESSION['USER'];
}
// Late profiling, only happening if early one wasn't started
if (!empty($CFG->profilingenabled)) {