Révision c9e51f47
Ajouté par Julien Enselme il y a environ 7 ans
drupal7/modules/simpletest/drupal_web_test_case.php | ||
---|---|---|
1374 | 1374 |
* @see DrupalWebTestCase::tearDown() |
1375 | 1375 |
*/ |
1376 | 1376 |
protected function prepareEnvironment() { |
1377 |
global $user, $language, $conf; |
|
1377 |
global $user, $language, $language_url, $conf;
|
|
1378 | 1378 |
|
1379 | 1379 |
// Store necessary current values before switching to prefixed database. |
1380 | 1380 |
$this->originalLanguage = $language; |
1381 |
$this->originalLanguageUrl = $language_url; |
|
1381 | 1382 |
$this->originalLanguageDefault = variable_get('language_default'); |
1382 | 1383 |
$this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files'); |
1383 | 1384 |
$this->originalProfile = drupal_get_profile(); |
... | ... | |
1387 | 1388 |
// Set to English to prevent exceptions from utf8_truncate() from t() |
1388 | 1389 |
// during install if the current language is not 'en'. |
1389 | 1390 |
// The following array/object conversion is copied from language_default(). |
1390 |
$language = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => ''); |
|
1391 |
$language_url = $language = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => '');
|
|
1391 | 1392 |
|
1392 | 1393 |
// Save and clean the shutdown callbacks array because it is static cached |
1393 | 1394 |
// and will be changed by the test run. Otherwise it will contain callbacks |
... | ... | |
1445 | 1446 |
* @see DrupalWebTestCase::prepareEnvironment() |
1446 | 1447 |
*/ |
1447 | 1448 |
protected function setUp() { |
1448 |
global $user, $language, $conf; |
|
1449 |
global $user, $language, $language_url, $conf;
|
|
1449 | 1450 |
|
1450 | 1451 |
// Create the database prefix for this test. |
1451 | 1452 |
$this->prepareDatabasePrefix(); |
... | ... | |
1542 | 1543 |
|
1543 | 1544 |
// Set up English language. |
1544 | 1545 |
unset($conf['language_default']); |
1545 |
$language = language_default(); |
|
1546 |
$language_url = $language = language_default();
|
|
1546 | 1547 |
|
1547 | 1548 |
// Use the test mail class instead of the default mail handler class. |
1548 | 1549 |
variable_set('mail_system', array('default-system' => 'TestingMailSystem')); |
... | ... | |
1636 | 1637 |
* and reset the database prefix. |
1637 | 1638 |
*/ |
1638 | 1639 |
protected function tearDown() { |
1639 |
global $user, $language; |
|
1640 |
global $user, $language, $language_url;
|
|
1640 | 1641 |
|
1641 | 1642 |
// In case a fatal error occurred that was not in the test process read the |
1642 | 1643 |
// log to pick up any fatal errors. |
... | ... | |
1701 | 1702 |
|
1702 | 1703 |
// Reset language. |
1703 | 1704 |
$language = $this->originalLanguage; |
1705 |
$language_url = $this->originalLanguageUrl; |
|
1704 | 1706 |
if ($this->originalLanguageDefault) { |
1705 | 1707 |
$GLOBALS['conf']['language_default'] = $this->originalLanguageDefault; |
1706 | 1708 |
} |
Formats disponibles : Unified diff
Udpate to 7.54