diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 6991056..e1c15fe 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -293,9 +293,7 @@ * @see http://php.net/manual/reserved.variables.server.php * @see http://php.net/manual/function.time.php */ -if (!defined('REQUEST_TIME')) { - define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']); -} +define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']); /** * Flag for drupal_set_title(); text is not sanitized, so run check_plain(). @@ -333,9 +331,7 @@ * * This strips two levels of directories off the current directory. */ -if (!defined('DRUPAL_ROOT')) { - define('DRUPAL_ROOT', dirname(dirname(__DIR__))); -} +define('DRUPAL_ROOT', dirname(dirname(__DIR__))); /** * Starts the timer with the specified name. diff --git a/core/tests/Drupal/Tests/Core/Route/RouterRoleTest.php b/core/tests/Drupal/Tests/Core/Route/RouterRoleTest.php index fd6d9e1..59b2fb3 100644 --- a/core/tests/Drupal/Tests/Core/Route/RouterRoleTest.php +++ b/core/tests/Drupal/Tests/Core/Route/RouterRoleTest.php @@ -17,7 +17,7 @@ use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; -// Needed because the User class calls it. +// Needed because the Entity class calls it. define('LANGUAGE_NOT_SPECIFIED', 'und'); /** @@ -26,15 +26,10 @@ class RouterRoleTest extends UnitTestCase { /** - * Modules to enable. + * Stores a list of user objects used in this test. * * @var array */ - public static $modules = array('router_test'); - - /** - * @var array - */ public $accounts = array(); public static function getInfo() { @@ -132,12 +127,11 @@ public function accountsToDeny($grant_users) { * @dataProvider testRoleAccessProvider */ public function testRoleAccess($path, $grant_accounts) { - // @todo Decide whether it's worth to manipulate global $user; and directly - // check the access or call the actual pages. $role_access_check = new RoleAccessCheck(); $collection = $this->getTestRouteCollection(); foreach ($grant_accounts as $account) { + // @todo Replace the global user with a properly injection session. $GLOBALS['user'] = $account; $subrequest = Request::create($path, 'GET');