updated drupal core to 7.43

This commit is contained in:
Bachir Soussi Chiadmi
2016-03-16 16:41:44 +01:00
parent 8fb9c70e42
commit b27aabe359
230 changed files with 4138 additions and 2075 deletions

View File

@@ -389,6 +389,18 @@ class ModuleDependencyTestCase extends ModuleTestCase {
);
}
/**
* Checks functionality of project namespaces for dependencies.
*/
function testProjectNamespaceForDependencies() {
// Enable module with project namespace to ensure nothing breaks.
$edit = array(
'modules[Testing][system_project_namespace_test][enable]' => TRUE,
);
$this->drupalPost('admin/modules', $edit, t('Save configuration'));
$this->assertModules(array('system_project_namespace_test'), TRUE);
}
/**
* Attempt to enable translation module without locale enabled.
*/
@@ -893,6 +905,29 @@ class CronRunTestCase extends DrupalWebTestCase {
$result = variable_get('common_test_cron');
$this->assertEqual($result, 'success', 'Cron correctly handles exceptions thrown during hook_cron() invocations.');
}
/**
* Tests that hook_flush_caches() is not invoked on every single cron run.
*
* @see system_cron()
*/
public function testCronCacheExpiration() {
module_enable(array('system_cron_test'));
variable_del('system_cron_test_flush_caches');
// Invoke cron the first time: hook_flush_caches() should be called and then
// get cached.
drupal_cron_run();
$this->assertEqual(variable_get('system_cron_test_flush_caches'), 1, 'hook_flush_caches() was invoked the first time.');
$cache = cache_get('system_cache_tables');
$this->assertEqual(empty($cache), FALSE, 'Cache is filled with cache table data.');
// Run cron again and ensure that hook_flush_caches() is not called.
variable_del('system_cron_test_flush_caches');
drupal_cron_run();
$this->assertNull(variable_get('system_cron_test_flush_caches'), 'hook_flush_caches() was not invoked the second time.');
}
}
/**
@@ -911,7 +946,7 @@ class CronQueueTestCase extends DrupalWebTestCase {
}
function setUp() {
parent::setUp(array('common_test', 'common_test_cron_helper'));
parent::setUp(array('common_test', 'common_test_cron_helper', 'cron_queue_test'));
}
/**
@@ -931,6 +966,23 @@ class CronQueueTestCase extends DrupalWebTestCase {
$this->assertEqual($queue->numberOfItems(), 1, 'Failing item still in the queue after throwing an exception.');
}
/**
* Tests worker defined as a class method callable.
*/
function testCallable() {
$queue = DrupalQueue::get('cron_queue_test_callback');
// Enqueue an item for processing.
$queue->createItem(array($this->randomName() => $this->randomName()));
// Run cron; the worker should perform the task and delete the item from the
// queue.
$this->cronRun();
// The queue should be empty.
$this->assertEqual($queue->numberOfItems(), 0);
}
}
class AdminMetaTagTestCase extends DrupalWebTestCase {
@@ -1298,7 +1350,23 @@ class DateTimeFunctionalTest extends DrupalWebTestCase {
$this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
$this->assertText(t('Custom date format updated.'), 'Custom date format successfully updated.');
// Check that ajax callback is protected by CSRF token.
$this->drupalGet('admin/config/regional/date-time/formats/lookup', array('query' => array('format' => 'Y m d')));
$this->assertResponse(403, 'Access denied with no token');
$this->drupalGet('admin/config/regional/date-time/formats/lookup', array('query' => array('token' => 'invalid', 'format' => 'Y m d')));
$this->assertResponse(403, 'Access denied with invalid token');
$this->drupalGet('admin/config/regional/date-time/formats');
$this->clickLink(t('edit'));
$settings = $this->drupalGetSettings();
$lookup_url = $settings['dateTime']['date-format']['lookup'];
preg_match('/token=([^&]+)/', $lookup_url, $matches);
$this->assertFalse(empty($matches[1]), 'Found token value');
$this->drupalGet('admin/config/regional/date-time/formats/lookup', array('query' => array('token' => $matches[1], 'format' => 'Y m d')));
$this->assertResponse(200, 'Access allowed with valid token');
$this->assertText(format_date(time(), 'custom', 'Y m d'));
// Delete custom date format.
$this->drupalGet('admin/config/regional/date-time/formats');
$this->clickLink(t('delete'));
$this->drupalPost($this->getUrl(), array(), t('Remove'));
$this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');