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

@ -162,8 +162,10 @@ class behat_hooks extends behat_base {
behat_selectors::register_moodle_selectors($session);
}
// Avoid some notices / warnings.
// Reset $SESSION.
$_SESSION = array();
$SESSION = new stdClass();
$_SESSION['SESSION'] =& $SESSION;
behat_util::reset_database();
behat_util::reset_dataroot();
@ -174,7 +176,7 @@ class behat_hooks extends behat_base {
// Reset the nasty strings list used during the last test.
nasty_strings::reset_used_strings();
// Assing valid data to admin user (some generator-related code needs a valid user).
// Assign valid data to admin user (some generator-related code needs a valid user).
$user = $DB->get_record('user', array('username' => 'admin'));
\core\session\manager::set_user($user);