Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions drupal_test_case.php
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,17 @@ protected function resetAll() {
*/
protected function refreshVariables() {
global $conf;
cache('bootstrap')->delete('variables');
if (!defined('DRUPAL_CORE_VERSION')) {
define('DRUPAL_CORE_VERSION', "8");
}


if (DRUPAL_CORE_VERSION == "7") {
cache_clear_all('variables', 'cache_bootstrap');
}
else {
cache('bootstrap')->delete('variables');
}
$conf = variable_initialize();
}

Expand Down Expand Up @@ -2385,7 +2395,17 @@ function setUp() {
if (!defined('DRUPAL_ROOT')) {
define('DRUPAL_ROOT', UPAL_ROOT);
}
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
if (!defined("DRUPAL_CORE_VERSION")) {
define('DRUPAL_CORE_VERSION', "8");
}

if (DRUPAL_CORE_VERSION == "7") {
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
}
// Assume D8
else {
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
}
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
}
Expand Down Expand Up @@ -2488,8 +2508,16 @@ public function setUp() {
//$_SERVER['REQUEST_METHOD'] = NULL;
//$_SERVER['SERVER_SOFTWARE'] = NULL;
//$_SERVER['HTTP_USER_AGENT'] = NULL;
if (!defined('DRUPAL_CORE_VERSION')) {
define('DRUPAL_CORE_VERSION', "8");
}

require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
if (DRUPAL_CORE_VERSION == "7") {
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
}
else {
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
}
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

// Enable modules for this test.
Expand Down Expand Up @@ -2532,6 +2560,8 @@ function upal_init() {
// The URL that browser based tests should use.
define('UPAL_WEB_URL', getenv('UPAL_WEB_URL') ? getenv('UPAL_WEB_URL') : (isset($GLOBALS['UPAL_WEB_URL']) ? $GLOBALS['UPAL_WEB_URL'] : 'http://upal'));

define('DRUPAL_CORE_VERSION', getenv('DRUPAL_CORE_VERSION') ? getenv('DRUPAL_CORE_VERSION') :(isset($GLOBALS['DRUPAL_CORE_VERSION']) ? $GLOBALS['DRUPAL_CORE_VERSION'] : "8"));

define('UPAL_TMP', getenv('UPAL_TMP') ? getenv('UPAL_TMP') : (isset($GLOBALS['UPAL_TMP']) ? $GLOBALS['UPAL_TMP'] : sys_get_temp_dir()));
// define('UNISH_SANDBOX', UNISH_TMP . '/drush-sandbox');

Expand Down
5 changes: 4 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<!--You currently need 'master' branch of drush after 2011.07.21. Drush 4.6 will be OK - http://drupal.org/node/1105514-->
<!--<var name="UNISH_DRUSH" value="/Users/mw/bin/drush"/>-->

<!-- Indicate your drupal core version. Defaults to Drupal 8. Not tested with D6 or older.-->
<!-- <var name="DRUPAL_CORE_VERSION" value="7" /> -->

<includePath>.</includePath>
</php>
</phpunit>
</phpunit>