updated core to 7.56, secutity update
This commit is contained in:
@@ -39,6 +39,13 @@ abstract class DrupalTestCase {
|
||||
*/
|
||||
protected $originalFileDirectory = NULL;
|
||||
|
||||
/**
|
||||
* URL to the verbose output file directory.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $verboseDirectoryUrl;
|
||||
|
||||
/**
|
||||
* Time limit for the test.
|
||||
*/
|
||||
@@ -461,8 +468,11 @@ abstract class DrupalTestCase {
|
||||
protected function verbose($message) {
|
||||
if ($id = simpletest_verbose($message)) {
|
||||
$class_safe = str_replace('\\', '_', get_class($this));
|
||||
$url = file_create_url($this->originalFileDirectory . '/simpletest/verbose/' . $class_safe . '-' . $id . '.html');
|
||||
$this->error(l(t('Verbose message'), $url, array('attributes' => array('target' => '_blank'))), 'User notice');
|
||||
$url = $this->verboseDirectoryUrl . '/' . $class_safe . '-' . $id . '.html';
|
||||
// Not using l() to avoid invoking the theme system, so that unit tests
|
||||
// can use verbose() as well.
|
||||
$link = '<a href="' . $url . '" target="_blank">' . t('Verbose message') . '</a>';
|
||||
$this->error($link, 'User notice');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,10 +729,17 @@ class DrupalUnitTestCase extends DrupalTestCase {
|
||||
* method.
|
||||
*/
|
||||
protected function setUp() {
|
||||
global $conf;
|
||||
global $conf, $language;
|
||||
|
||||
// Store necessary current values before switching to the test environment.
|
||||
$this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files');
|
||||
$this->verboseDirectoryUrl = file_create_url($this->originalFileDirectory . '/simpletest/verbose');
|
||||
|
||||
// Set up English language.
|
||||
$this->originalLanguage = $language;
|
||||
$this->originalLanguageDefault = variable_get('language_default');
|
||||
unset($conf['language_default']);
|
||||
$language = language_default();
|
||||
|
||||
// Reset all statics so that test is performed with a clean environment.
|
||||
drupal_static_reset();
|
||||
@@ -764,7 +781,7 @@ class DrupalUnitTestCase extends DrupalTestCase {
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
global $conf;
|
||||
global $conf, $language;
|
||||
|
||||
// Get back to the original connection.
|
||||
Database::removeConnection('default');
|
||||
@@ -775,6 +792,12 @@ class DrupalUnitTestCase extends DrupalTestCase {
|
||||
if (isset($this->originalModuleList)) {
|
||||
module_list(TRUE, FALSE, FALSE, $this->originalModuleList);
|
||||
}
|
||||
|
||||
// Reset language.
|
||||
$language = $this->originalLanguage;
|
||||
if ($this->originalLanguageDefault) {
|
||||
$GLOBALS['conf']['language_default'] = $this->originalLanguageDefault;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1381,6 +1404,7 @@ class DrupalWebTestCase extends DrupalTestCase {
|
||||
$this->originalLanguageUrl = $language_url;
|
||||
$this->originalLanguageDefault = variable_get('language_default');
|
||||
$this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files');
|
||||
$this->verboseDirectoryUrl = file_create_url($this->originalFileDirectory . '/simpletest/verbose');
|
||||
$this->originalProfile = drupal_get_profile();
|
||||
$this->originalCleanUrl = variable_get('clean_url', 0);
|
||||
$this->originalUser = $user;
|
||||
|
Reference in New Issue
Block a user