drupal core updated to 7.28

This commit is contained in:
Bachir Soussi Chiadmi
2014-07-07 18:53:44 +02:00
parent 10de06dd70
commit c3011cef61
263 changed files with 3331 additions and 8894 deletions

View File

@@ -541,6 +541,15 @@ abstract class DrupalTestCase {
E_RECOVERABLE_ERROR => 'Recoverable error',
);
// PHP 5.3 adds new error logging constants. Add these conditionally for
// backwards compatibility with PHP 5.2.
if (defined('E_DEPRECATED')) {
$error_map += array(
E_DEPRECATED => 'Deprecated',
E_USER_DEPRECATED => 'User deprecated',
);
}
$backtrace = debug_backtrace();
$this->error($message, $error_map[$severity], _drupal_get_last_caller($backtrace));
}
@@ -730,6 +739,10 @@ class DrupalUnitTestCase extends DrupalTestCase {
// subsequently will fail as the database is not accessible.
$module_list = module_list();
if (isset($module_list['locale'])) {
// Transform the list into the format expected as input to module_list().
foreach ($module_list as &$module) {
$module = array('filename' => drupal_get_filename('module', $module));
}
$this->originalModuleList = $module_list;
unset($module_list['locale']);
module_list(TRUE, FALSE, FALSE, $module_list);
@@ -1132,7 +1145,7 @@ class DrupalWebTestCase extends DrupalTestCase {
}
/**
* Internal helper function; Create a role with specified permissions.
* Creates a role with specified permissions.
*
* @param $permissions
* Array of permission names to assign to role.
@@ -2042,7 +2055,14 @@ class DrupalWebTestCase extends DrupalTestCase {
foreach ($upload as $key => $file) {
$file = drupal_realpath($file);
if ($file && is_file($file)) {
$post[$key] = '@' . $file;
// Use the new CurlFile class for file uploads when using PHP
// 5.5 or higher.
if (class_exists('CurlFile')) {
$post[$key] = curl_file_create($file);
}
else {
$post[$key] = '@' . $file;
}
}
}
}
@@ -2249,6 +2269,13 @@ class DrupalWebTestCase extends DrupalTestCase {
}
break;
case 'updateBuildId':
$buildId = $xpath->query('//input[@name="form_build_id" and @value="' . $command['old'] . '"]')->item(0);
if ($buildId) {
$buildId->setAttribute('value', $command['new']);
}
break;
// @todo Add suitable implementations for these commands in order to
// have full test coverage of what ajax.js can do.
case 'remove':
@@ -2267,6 +2294,14 @@ class DrupalWebTestCase extends DrupalTestCase {
}
$this->drupalSetContent($content);
$this->drupalSetSettings($drupal_settings);
$verbose = 'AJAX POST request to: ' . $path;
$verbose .= '<br />AJAX callback path: ' . $ajax_path;
$verbose .= '<hr />Ending URL: ' . $this->getUrl();
$verbose .= '<hr />' . $this->content;
$this->verbose($verbose);
return $return;
}