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

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -7,6 +7,8 @@
*/
/**
* Implements callback_batch_operation().
*
* Simple batch operation.
*/
function _batch_test_callback_1($id, $sleep, &$context) {
@@ -20,6 +22,8 @@ function _batch_test_callback_1($id, $sleep, &$context) {
}
/**
* Implements callback_batch_operation().
*
* Multistep batch operation.
*/
function _batch_test_callback_2($start, $total, $sleep, &$context) {
@@ -53,6 +57,8 @@ function _batch_test_callback_2($start, $total, $sleep, &$context) {
}
/**
* Implements callback_batch_operation().
*
* Simple batch operation.
*/
function _batch_test_callback_5($id, $sleep, &$context) {
@@ -68,6 +74,8 @@ function _batch_test_callback_5($id, $sleep, &$context) {
}
/**
* Implements callback_batch_operation().
*
* Batch operation setting up its own batch.
*/
function _batch_test_nested_batch_callback() {
@@ -76,6 +84,8 @@ function _batch_test_nested_batch_callback() {
}
/**
* Implements callback_batch_finished().
*
* Common 'finished' callbacks for batches 1 to 4.
*/
function _batch_test_finished_helper($batch_id, $success, $results, $operations) {
@@ -99,6 +109,8 @@ function _batch_test_finished_helper($batch_id, $success, $results, $operations)
}
/**
* Implements callback_batch_finished().
*
* 'finished' callback for batch 0.
*/
function _batch_test_finished_0($success, $results, $operations) {
@@ -106,6 +118,8 @@ function _batch_test_finished_0($success, $results, $operations) {
}
/**
* Implements callback_batch_finished().
*
* 'finished' callback for batch 1.
*/
function _batch_test_finished_1($success, $results, $operations) {
@@ -113,6 +127,8 @@ function _batch_test_finished_1($success, $results, $operations) {
}
/**
* Implements callback_batch_finished().
*
* 'finished' callback for batch 2.
*/
function _batch_test_finished_2($success, $results, $operations) {
@@ -120,6 +136,8 @@ function _batch_test_finished_2($success, $results, $operations) {
}
/**
* Implements callback_batch_finished().
*
* 'finished' callback for batch 3.
*/
function _batch_test_finished_3($success, $results, $operations) {
@@ -127,6 +145,8 @@ function _batch_test_finished_3($success, $results, $operations) {
}
/**
* Implements callback_batch_finished().
*
* 'finished' callback for batch 4.
*/
function _batch_test_finished_4($success, $results, $operations) {
@@ -134,6 +154,8 @@ function _batch_test_finished_4($success, $results, $operations) {
}
/**
* Implements callback_batch_finished().
*
* 'finished' callback for batch 5.
*/
function _batch_test_finished_5($success, $results, $operations) {

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -0,0 +1,38 @@
<?php
/**
* Perform early bootstrap tests.
*/
class EarlyBootstrapTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Early bootstrap test',
'description' => 'Confirm that calling module_implements() during early bootstrap does not pollute the module_implements() cache.',
'group' => 'System',
);
}
function setUp() {
parent::setUp('boot_test_1', 'boot_test_2');
}
/**
* Test hook_boot() on both regular and "early exit" pages.
*/
public function testHookBoot() {
$paths = array('', 'early_exit');
foreach ($paths as $path) {
// Empty the module_implements() caches.
module_implements(NULL, FALSE, TRUE);
// Do a request to the front page, which will call module_implements()
// during hook_boot().
$this->drupalGet($path);
// Reset the static cache so we get implementation data from the persistent
// cache.
drupal_static_reset();
// Make sure we get a full list of all modules implementing hook_help().
$modules = module_implements('help');
$this->assertTrue(in_array('boot_test_2', $modules));
}
}
}

View File

@@ -0,0 +1,12 @@
name = Early bootstrap tests
description = A support module for hook_boot testing.
core = 7.x
package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1456343506"

View File

@@ -0,0 +1,21 @@
<?php
/**
* @file
* Tests calling module_implements() during hook_boot() invocation.
*/
/**
* Implements hook_boot().
*/
function boot_test_1_boot() {
// Calling module_implements during hook_boot() will return "vital" modules
// only, and this list of modules will be statically cached.
module_implements('help');
// Define a special path to test that the static cache isn't written away
// if we exit before having completed the bootstrap.
if ($_GET['q'] == 'early_exit') {
module_implements_write_cache();
exit();
}
}

View File

@@ -0,0 +1,12 @@
name = Early bootstrap tests
description = A support module for hook_boot hook testing.
core = 7.x
package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1456343506"

View File

@@ -0,0 +1,13 @@
<?php
/**
* @file
* Defines a hook_help() implementation in a non-"bootstrap" module.
*/
/**
* Implements hook_help().
*/
function boot_test_2_help($path, $arg) {
// Empty hook.
}

View File

@@ -152,7 +152,7 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
$this->drupalLogin($user);
$this->drupalGet('', array(), array('If-Modified-Since: ' . $last_modified, 'If-None-Match: ' . $etag));
$this->assertResponse(200, 'Conditional request returned 200 OK for authenticated user.');
$this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), 'Absense of Page was not cached.');
$this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), 'Absence of Page was not cached.');
$this->assertFalse($this->drupalGetHeader('ETag'), 'ETag HTTP headers are not present for logged in users.');
$this->assertFalse($this->drupalGetHeader('Last-Modified'), 'Last-Modified HTTP headers are not present for logged in users.');
}
@@ -313,6 +313,10 @@ class BootstrapAutoloadTestCase extends DrupalWebTestCase {
$this->assertTrue(drupal_autoload_interface('drupalautoloadtestinterface'), 'drupal_autoload_interface() recognizes <em>DrupalAutoloadTestInterface</em> in lower case.');
// Test class autoloader.
$this->assertTrue(drupal_autoload_class('drupalautoloadtestclass'), 'drupal_autoload_class() recognizes <em>DrupalAutoloadTestClass</em> in lower case.');
// Test trait autoloader.
if (version_compare(PHP_VERSION, '5.4') >= 0) {
$this->assertTrue(drupal_autoload_trait('drupalautoloadtesttrait'), 'drupal_autoload_trait() recognizes <em>DrupalAutoloadTestTrait</em> in lower case.');
}
}
}

View File

@@ -372,6 +372,65 @@ class CommonURLUnitTest extends DrupalWebTestCase {
}
}
/**
* Tests url_is_external().
*/
class UrlIsExternalUnitTest extends DrupalUnitTestCase {
public static function getInfo() {
return array(
'name' => 'External URL checking',
'description' => 'Performs tests on url_is_external().',
'group' => 'System',
);
}
/**
* Tests if each URL is external or not.
*/
function testUrlIsExternal() {
foreach ($this->examples() as $path => $expected) {
$this->assertIdentical(url_is_external($path), $expected, $path);
}
}
/**
* Provides data for testUrlIsExternal().
*
* @return array
* An array of test data, keyed by a path, with the expected value where
* TRUE is external, and FALSE is not external.
*/
protected function examples() {
return array(
// Simple external URLs.
'http://example.com' => TRUE,
'https://example.com' => TRUE,
'http://drupal.org/foo/bar?foo=bar&bar=baz&baz#foo' => TRUE,
'//drupal.org' => TRUE,
// Some browsers ignore or strip leading control characters.
"\x00//www.example.com" => TRUE,
"\x08//www.example.com" => TRUE,
"\x1F//www.example.com" => TRUE,
"\n//www.example.com" => TRUE,
// JSON supports decoding directly from UTF-8 code points.
json_decode('"\u00AD"') . "//www.example.com" => TRUE,
json_decode('"\u200E"') . "//www.example.com" => TRUE,
json_decode('"\uE0020"') . "//www.example.com" => TRUE,
json_decode('"\uE000"') . "//www.example.com" => TRUE,
// Backslashes should be normalized to forward.
'\\\\example.com' => TRUE,
// Local URLs.
'node' => FALSE,
'/system/ajax' => FALSE,
'?q=foo:bar' => FALSE,
'node/edit:me' => FALSE,
'/drupal.org' => FALSE,
'<front>' => FALSE,
);
}
}
/**
* Tests for check_plain(), filter_xss(), format_string(), and check_url().
*/
@@ -1256,6 +1315,15 @@ class DrupalGotoTest extends DrupalWebTestCase {
$this->assertText('drupal_goto', 'Drupal goto redirect succeeded.');
$this->assertEqual($this->getUrl(), url('common-test/drupal_goto', array('query' => array('foo' => '123'), 'absolute' => TRUE)), 'Drupal goto redirected to expected URL.');
// Test that calling drupal_goto() on the current path is not dangerous.
variable_set('common_test_redirect_current_path', TRUE);
$this->drupalGet('', array('query' => array('q' => 'http://www.example.com/')));
$headers = $this->drupalGetHeaders(TRUE);
list(, $status) = explode(' ', $headers[0][':status'], 3);
$this->assertEqual($status, 302, 'Expected response code was sent.');
$this->assertNotEqual($this->getUrl(), 'http://www.example.com/', 'Drupal goto did not redirect to external URL.');
$this->assertTrue(strpos($this->getUrl(), url('<front>', array('absolute' => TRUE))) === 0, 'Drupal redirected to itself.');
variable_del('common_test_redirect_current_path');
// Test that drupal_goto() respects ?destination=xxx. Use an complicated URL
// to test that the path is encoded and decoded properly.
$destination = 'common-test/drupal_goto/destination?foo=%2525&bar=123';

View File

@@ -7,8 +7,8 @@ stylesheets[all][] = common_test.css
stylesheets[print][] = common_test.print.css
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -92,6 +92,15 @@ function common_test_drupal_goto_alter(&$path, &$options, &$http_response_code)
}
}
/**
* Implements hook_init().
*/
function common_test_init() {
if (variable_get('common_test_redirect_current_path', FALSE)) {
drupal_goto(current_path());
}
}
/**
* Print destination query parameter.
*/

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -7,8 +7,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -4,3 +4,19 @@
* @file
* Test module to check code registry.
*/
/**
* Implements hook_registry_files_alter().
*/
function drupal_autoload_test_registry_files_alter(&$files, $modules) {
foreach ($modules as $module) {
// Add the drupal_autoload_test_trait.sh file to the registry when PHP 5.4+
// is being used.
if ($module->name == 'drupal_autoload_test' && version_compare(PHP_VERSION, '5.4') >= 0) {
$files["$module->dir/drupal_autoload_test_trait.sh"] = array(
'module' => $module->name,
'weight' => $module->weight,
);
}
}
}

View File

@@ -0,0 +1,16 @@
<?php
/**
* @file
* Test traits for code registry testing.
*
* This file has a non-standard extension to prevent PHP < 5.4 testbots from
* trying to run a syntax check on it.
* @todo Use a standard extension once the testbots allow it. See
* https://www.drupal.org/node/2589649.
*/
/**
* This trait is empty because we only care if Drupal can find it.
*/
trait DrupalAutoloadTestTrait {}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -6,8 +6,8 @@ core = 7.x
dependencies[] = entity_cache_test_dependency
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -6,8 +6,8 @@ core = 7.x
files[] = file_test.module
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -441,7 +441,7 @@ class DrupalHtmlToTextTestCase extends DrupalWebTestCase {
* <CRLF> is 1000 characters."
*/
function testVeryLongLineWrap() {
$input = 'Drupal<br /><p>' . str_repeat('x', 2100) . '</><br />Drupal';
$input = 'Drupal<br /><p>' . str_repeat('x', 2100) . '</p><br />Drupal';
$output = drupal_html_to_text($input);
// This awkward construct comes from includes/mail.inc lines 8-13.
$eol = variable_get('mail_line_endings', MAIL_LINE_ENDINGS);
@@ -455,7 +455,6 @@ class DrupalHtmlToTextTestCase extends DrupalWebTestCase {
$maximum_line_length = max($maximum_line_length, strlen($line . $eol));
}
$verbose = 'Maximum line length found was ' . $maximum_line_length . ' octets.';
// @todo This should assert that $maximum_line_length <= 1000.
$this->pass($verbose);
$this->assertTrue($maximum_line_length <= 1000, $verbose);
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -302,3 +302,45 @@ class ModuleUninstallTestCase extends DrupalWebTestCase {
$this->assertEqual(0, $count, 'Permissions were all removed.');
}
}
class ModuleImplementsAlterTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Module implements alter',
'description' => 'Tests hook_module_implements_alter().',
'group' => 'Module',
);
}
/**
* Tests hook_module_implements_alter() adding an implementation.
*/
function testModuleImplementsAlter() {
module_enable(array('module_test'), FALSE);
$this->assertTrue(module_exists('module_test'), 'Test module is enabled.');
// Assert that module_test.module is now included.
$this->assertTrue(function_exists('module_test_permission'),
'The file module_test.module was successfully included.');
$modules = module_implements('permission');
$this->assertTrue(in_array('module_test', $modules), 'module_test implements hook_permission.');
$modules = module_implements('module_implements_alter');
$this->assertTrue(in_array('module_test', $modules), 'module_test implements hook_module_implements_alter().');
// Assert that module_test.implementations.inc is not included yet.
$this->assertFalse(function_exists('module_test_altered_test_hook'),
'The file module_test.implementations.inc is not included yet.');
// Assert that module_test_module_implements_alter(*, 'altered_test_hook')
// has added an implementation
$this->assertTrue(in_array('module_test', module_implements('altered_test_hook')),
'module_test implements hook_altered_test_hook().');
// Assert that module_test.implementations.inc was included as part of the process.
$this->assertTrue(function_exists('module_test_altered_test_hook'),
'The file module_test.implementations.inc was included.');
}
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* Implements hook_altered_test_hook()
*
* @see module_test_module_implements_alter()
*/
function module_test_altered_test_hook() {
return __FUNCTION__;
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -129,3 +129,14 @@ function module_test_modules_uninstalled($modules) {
// can check that the modules were uninstalled in the correct sequence.
variable_set('test_module_uninstall_order', $modules);
}
/**
* Implements hook_module_implements_alter()
*/
function module_test_module_implements_alter(&$implementations, $hook) {
if ($hook === 'altered_test_hook') {
// Add a hook implementation, that will be found in
// module_test.implementations.inc.
$implementations['module_test'] = 'implementations';
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ core = 7.x
hidden = TRUE
package = Testing
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ core = 7.x
hidden = TRUE
package = Testing
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -7,8 +7,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -6,8 +6,8 @@ core = 7.x
hidden = TRUE
dependencies[] = _missing_dependency
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -6,8 +6,8 @@ core = 7.x
hidden = TRUE
dependencies[] = system_incompatible_core_version_test
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 5.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -7,8 +7,8 @@ hidden = TRUE
; system_incompatible_module_version_test declares version 1.0
dependencies[] = system_incompatible_module_version_test (>2.0)
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = 1.0
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -0,0 +1,13 @@
name = "System project namespace test"
description = "Support module for testing project namespace dependencies."
package = Testing
version = VERSION
core = 7.x
hidden = TRUE
dependencies[] = drupal:filter
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1456343506"

View File

@@ -0,0 +1 @@
<?php

View File

@@ -6,8 +6,8 @@ core = 7.x
files[] = system_test.module
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -296,6 +296,9 @@ function system_test_system_info_alter(&$info, $file, $type) {
}
}
if ($file->name == 'system_project_namespace_test') {
$info['hidden'] = FALSE;
}
// Make the system_dependencies_test visible by default.
if ($file->name == 'system_dependencies_test') {
$info['hidden'] = FALSE;

View File

@@ -6,8 +6,8 @@ core = 7.x
hidden = TRUE
dependencies[] = taxonomy
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -6,8 +6,8 @@ hidden = TRUE
settings[basetheme_only] = base theme value
settings[subtheme_override] = base theme value
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -6,8 +6,8 @@ hidden = TRUE
settings[subtheme_override] = subtheme value
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -17,8 +17,8 @@ stylesheets[all][] = system.base.css
settings[theme_test_setting] = default value
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -127,6 +127,38 @@ db_insert('files')->fields(array(
'status' => '1',
'timestamp' => '1285708958',
))
// On some Drupal 6 sites, more than one file can have the same filepath. See
// https://www.drupal.org/node/1260938.
->values(array(
'fid' => '12',
'uid' => '1',
'filename' => 'duplicate-name.png',
'filepath' => 'sites/default/files/duplicate-name.png',
'filemime' => 'image/png',
'filesize' => '314',
'status' => '1',
'timestamp' => '1285708958',
))
->values(array(
'fid' => '13',
'uid' => '1',
'filename' => 'duplicate-name.png',
'filepath' => 'sites/default/files/duplicate-name.png',
'filemime' => 'image/png',
'filesize' => '315',
'status' => '1',
'timestamp' => '1285708958',
))
->values(array(
'fid' => '14',
'uid' => '1',
'filename' => 'duplicate-name.png',
'filepath' => 'sites/default/files/duplicate-name.png',
'filemime' => 'image/png',
'filesize' => '316',
'status' => '1',
'timestamp' => '1285708958',
))
->execute();
db_insert('node')->fields(array(
@@ -196,6 +228,23 @@ db_insert('node')->fields(array(
'sticky' => '0',
'tnid' => '0',
'translate' => '0',
))
->values(array(
'nid' => '41',
'vid' => '55',
'type' => 'page',
'language' => '',
'title' => 'node title 41 revision 55',
'uid' => '1',
'status' => '1',
'created' => '1285709012',
'changed' => '1285709012',
'comment' => '0',
'promote' => '0',
'moderate' => '0',
'sticky' => '0',
'tnid' => '0',
'translate' => '0',
))
->execute();
@@ -253,6 +302,28 @@ db_insert('node_revisions')->fields(array(
'log' => '',
'timestamp' => '1285709012',
'format' => '1',
))
->values(array(
'nid' => '41',
'vid' => '54',
'uid' => '1',
'title' => 'node title 41 revision 54',
'body' => "Attachments:\r\nduplicate-name.png",
'teaser' => "Attachments:\r\nduplicate-name.png",
'log' => '',
'timestamp' => '1285709012',
'format' => '1',
))
->values(array(
'nid' => '41',
'vid' => '55',
'uid' => '1',
'title' => 'node title 41 revision 55',
'body' => "Attachments:\r\nduplicate-name.png\r\nduplicate-name.png",
'teaser' => "Attachments:\r\nduplicate-name.png\r\nduplicate-name.png",
'log' => '',
'timestamp' => '1285709012',
'format' => '1',
))
->execute();
@@ -415,6 +486,30 @@ db_insert('upload')->fields(array(
'list' => '1',
'weight' => '0',
))
->values(array(
'fid' => '12',
'nid' => '41',
'vid' => '54',
'description' => 'duplicate-name.png',
'list' => '1',
'weight' => '0',
))
->values(array(
'fid' => '13',
'nid' => '41',
'vid' => '55',
'description' => 'first description',
'list' => '0',
'weight' => '0',
))
->values(array(
'fid' => '14',
'nid' => '41',
'vid' => '55',
'description' => 'second description',
'list' => '1',
'weight' => '0',
))
->execute();
// Add series of entries for invalid node vids to the {upload} table.
@@ -431,7 +526,7 @@ for ($i = 30; $i < 250; $i += 2) {
->values(array(
'fid' => $i,
'nid' => '40',
'vid' => 24 + $i,
'vid' => 26 + $i,
'description' => 'crazy-basename.png',
'list' => '1',
'weight' => '0',
@@ -440,7 +535,7 @@ for ($i = 30; $i < 250; $i += 2) {
->values(array(
'fid' => 2,
'nid' => '40',
'vid' => 24 + $i + 1,
'vid' => 26 + $i + 1,
'description' => 'crazy-basename.png',
'list' => '1',
'weight' => '0',

View File

@@ -64,12 +64,35 @@ class UploadUpgradePathTestCase extends UpgradePathTestCase {
}
$this->assertIdentical($filenames, $recorded_filenames, 'The uploaded files are present in the same order after the upgrade.');
}
// Test for the file with repeating basename to only have the streaming
// path replaced.
$node = node_load(40, 53);
$repeated_basename_file = $node->upload[LANGUAGE_NONE][4];
$this->assertEqual($repeated_basename_file['uri'], 'private://drupal-6/file/directory/path/crazy-basename.png', "The file with the repeated basename path only had the stream portion replaced");
// Ensure that filepaths are deduplicated.
$node0 = node_load(41, 54);
$node1 = node_load(41, 55);
// Ensure that both revisions point to the same file ID.
$items0 = field_get_items('node', $node0, 'upload');
$this->assertEqual(count($items0), 1);
$items1 = field_get_items('node', $node1, 'upload');
$this->assertEqual(count($items1), 2);
$this->assertEqual($items0[0]['fid'], $items1[0]['fid']);
$this->assertEqual($items0[0]['fid'], $items1[1]['fid']);
// The revision with more than one reference to the same file should retain
// the original settings for each reference.
$this->assertEqual($items1[0]['description'], 'first description');
$this->assertEqual($items1[0]['display'], 0);
$this->assertEqual($items1[1]['description'], 'second description');
$this->assertEqual($items1[1]['display'], 1);
// Ensure that the latest version of the files are used.
$this->assertEqual($items1[0]['filesize'], 316);
$this->assertEqual($items1[1]['filesize'], 316);
// No duplicate files should remain on the Drupal 7 site.
$this->assertEqual(0, db_query("SELECT COUNT(*) FROM {file_managed} GROUP BY uri HAVING COUNT(fid) > 1")->fetchField());
// Make sure the file settings were properly migrated.
$d6_file_directory_temp = '/drupal-6/file/directory/temp';
$d6_file_directory_path = '/drupal-6/file/directory/path';

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"

View File

@@ -246,4 +246,38 @@ class XMLRPCMessagesTestCase extends DrupalWebTestCase {
$this->assertEqual($removed, 'system.methodSignature', 'Hiding builting system.methodSignature with hook_xmlrpc_alter works');
}
/**
* Test limits on system.multicall that can prevent brute-force attacks.
*/
function testMulticallLimit() {
$url = url(NULL, array('absolute' => TRUE)) . 'xmlrpc.php';
$multicall_args = array();
$num_method_calls = 10;
for ($i = 0; $i < $num_method_calls; $i++) {
$struct = array('i' => $i);
$multicall_args[] = array('methodName' => 'validator1.echoStructTest', 'params' => array($struct));
}
// Test limits of 1, 5, 9, 13.
for ($limit = 1; $limit < $num_method_calls + 4; $limit += 4) {
variable_set('xmlrpc_multicall_duplicate_method_limit', $limit);
$results = xmlrpc($url, array('system.multicall' => array($multicall_args)));
$this->assertEqual($num_method_calls, count($results));
for ($i = 0; $i < min($limit, $num_method_calls); $i++) {
$x = array_shift($results);
$this->assertTrue(empty($x->is_error), "Result $i is not an error");
$this->assertEqual($multicall_args[$i]['params'][0], $x);
}
for (; $i < $num_method_calls; $i++) {
$x = array_shift($results);
$this->assertFalse(empty($x->is_error), "Result $i is an error");
$this->assertEqual(-156579, $x->code);
}
}
variable_set('xmlrpc_multicall_duplicate_method_limit', -1);
$results = xmlrpc($url, array('system.multicall' => array($multicall_args)));
$this->assertEqual($num_method_calls, count($results));
foreach ($results as $i => $x) {
$this->assertTrue(empty($x->is_error), "Result $i is not an error");
}
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.39"
; Information added by Drupal.org packaging script on 2016-02-24
version = "7.43"
project = "drupal"
datestamp = "1440020197"
datestamp = "1456343506"