updated core to 7.73

This commit is contained in:
2020-09-24 17:04:08 +02:00
parent 084d28842a
commit 7d87153100
524 changed files with 25194 additions and 7745 deletions
@@ -19919,7 +19919,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '1',
'name' => 'vocabulary 1 (i=0)',
'description' => 'description of vocabulary 1 (i=0)',
'help' => '',
'help' => 'help for vocabulary 1 (i=0)',
'relations' => '1',
'hierarchy' => '0',
'multiple' => '0',
@@ -19932,7 +19932,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '2',
'name' => 'vocabulary 2 (i=1)',
'description' => 'description of vocabulary 2 (i=1)',
'help' => '',
'help' => 'help for vocabulary 2 (i=1)',
'relations' => '1',
'hierarchy' => '1',
'multiple' => '1',
@@ -19945,7 +19945,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '3',
'name' => 'vocabulary 3 (i=2)',
'description' => 'description of vocabulary 3 (i=2)',
'help' => '',
'help' => 'help for vocabulary 3 (i=2)',
'relations' => '1',
'hierarchy' => '2',
'multiple' => '0',
@@ -19958,7 +19958,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '4',
'name' => 'vocabulary 4 (i=3)',
'description' => 'description of vocabulary 4 (i=3)',
'help' => '',
'help' => 'help for vocabulary 4 (i=3)',
'relations' => '1',
'hierarchy' => '0',
'multiple' => '1',
@@ -19971,7 +19971,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '5',
'name' => 'vocabulary 5 (i=4)',
'description' => 'description of vocabulary 5 (i=4)',
'help' => '',
'help' => 'help for vocabulary 5 (i=4)',
'relations' => '1',
'hierarchy' => '1',
'multiple' => '0',
@@ -19984,7 +19984,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '6',
'name' => 'vocabulary 6 (i=5)',
'description' => 'description of vocabulary 6 (i=5)',
'help' => '',
'help' => 'help for vocabulary 6 (i=5)',
'relations' => '1',
'hierarchy' => '2',
'multiple' => '1',
@@ -19997,7 +19997,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '7',
'name' => 'vocabulary 7 (i=6)',
'description' => 'description of vocabulary 7 (i=6)',
'help' => '',
'help' => 'help for vocabulary 7 (i=6)',
'relations' => '1',
'hierarchy' => '0',
'multiple' => '0',
@@ -20010,7 +20010,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '8',
'name' => 'vocabulary 8 (i=7)',
'description' => 'description of vocabulary 8 (i=7)',
'help' => '',
'help' => 'help for vocabulary 8 (i=7)',
'relations' => '1',
'hierarchy' => '1',
'multiple' => '1',
@@ -20023,7 +20023,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '9',
'name' => 'vocabulary 9 (i=8)',
'description' => 'description of vocabulary 9 (i=8)',
'help' => '',
'help' => 'help for vocabulary 9 (i=8)',
'relations' => '1',
'hierarchy' => '2',
'multiple' => '0',
@@ -20036,7 +20036,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '10',
'name' => 'vocabulary 10 (i=9)',
'description' => 'description of vocabulary 10 (i=9)',
'help' => '',
'help' => 'help for vocabulary 10 (i=9)',
'relations' => '1',
'hierarchy' => '0',
'multiple' => '1',
@@ -20049,7 +20049,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '11',
'name' => 'vocabulary 11 (i=10)',
'description' => 'description of vocabulary 11 (i=10)',
'help' => '',
'help' => 'help for vocabulary 11 (i=10)',
'relations' => '1',
'hierarchy' => '1',
'multiple' => '0',
@@ -20062,7 +20062,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '12',
'name' => 'vocabulary 12 (i=11)',
'description' => 'description of vocabulary 12 (i=11)',
'help' => '',
'help' => 'help for vocabulary 12 (i=11)',
'relations' => '1',
'hierarchy' => '2',
'multiple' => '1',
@@ -20075,7 +20075,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '13',
'name' => 'vocabulary 13 (i=12)',
'description' => 'description of vocabulary 13 (i=12)',
'help' => '',
'help' => 'help for vocabulary 13 (i=12)',
'relations' => '1',
'hierarchy' => '0',
'multiple' => '0',
@@ -20088,7 +20088,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '14',
'name' => 'vocabulary 14 (i=13)',
'description' => 'description of vocabulary 14 (i=13)',
'help' => '',
'help' => 'help for vocabulary 14 (i=13)',
'relations' => '1',
'hierarchy' => '1',
'multiple' => '1',
@@ -20101,7 +20101,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '15',
'name' => 'vocabulary 15 (i=14)',
'description' => 'description of vocabulary 15 (i=14)',
'help' => '',
'help' => 'help for vocabulary 15 (i=14)',
'relations' => '1',
'hierarchy' => '2',
'multiple' => '0',
@@ -20114,7 +20114,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '16',
'name' => 'vocabulary 16 (i=15)',
'description' => 'description of vocabulary 16 (i=15)',
'help' => '',
'help' => 'help for vocabulary 16 (i=15)',
'relations' => '1',
'hierarchy' => '0',
'multiple' => '1',
@@ -20127,7 +20127,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '17',
'name' => 'vocabulary 17 (i=16)',
'description' => 'description of vocabulary 17 (i=16)',
'help' => '',
'help' => 'help for vocabulary 17 (i=16)',
'relations' => '1',
'hierarchy' => '1',
'multiple' => '0',
@@ -20140,7 +20140,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '18',
'name' => 'vocabulary 18 (i=17)',
'description' => 'description of vocabulary 18 (i=17)',
'help' => '',
'help' => 'help for vocabulary 18 (i=17)',
'relations' => '1',
'hierarchy' => '2',
'multiple' => '1',
@@ -20153,7 +20153,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '19',
'name' => 'vocabulary 19 (i=18)',
'description' => 'description of vocabulary 19 (i=18)',
'help' => '',
'help' => 'help for vocabulary 19 (i=18)',
'relations' => '1',
'hierarchy' => '0',
'multiple' => '0',
@@ -20166,7 +20166,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '20',
'name' => 'vocabulary 20 (i=19)',
'description' => 'description of vocabulary 20 (i=19)',
'help' => '',
'help' => 'help for vocabulary 20 (i=19)',
'relations' => '1',
'hierarchy' => '1',
'multiple' => '1',
@@ -20179,7 +20179,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '21',
'name' => 'vocabulary 21 (i=20)',
'description' => 'description of vocabulary 21 (i=20)',
'help' => '',
'help' => 'help for vocabulary 21 (i=20)',
'relations' => '1',
'hierarchy' => '2',
'multiple' => '0',
@@ -20192,7 +20192,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '22',
'name' => 'vocabulary 22 (i=21)',
'description' => 'description of vocabulary 22 (i=21)',
'help' => '',
'help' => 'help for vocabulary 22 (i=21)',
'relations' => '1',
'hierarchy' => '0',
'multiple' => '1',
@@ -20205,7 +20205,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '23',
'name' => 'vocabulary 23 (i=22)',
'description' => 'description of vocabulary 23 (i=22)',
'help' => '',
'help' => 'help for vocabulary 23 (i=22)',
'relations' => '1',
'hierarchy' => '1',
'multiple' => '0',
@@ -20218,7 +20218,7 @@ db_insert('vocabulary')->fields(array(
'vid' => '24',
'name' => 'vocabulary 24 (i=23)',
'description' => 'description of vocabulary 24 (i=23)',
'help' => '',
'help' => 'help for vocabulary 24 (i=23)',
'relations' => '1',
'hierarchy' => '2',
'multiple' => '1',
@@ -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',
@@ -34,7 +34,7 @@ class FieldUpdatePathTestCase extends UpdatePathTestCase {
* Tests that the update is successful.
*/
public function testFilledUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The update was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The update was completed successfully.');
$expected_settings = array(
'extra_fields' => array(
'display' => array(
@@ -32,6 +32,6 @@ class TriggerUpdatePathTestCase extends UpdatePathTestCase {
* Tests that the upgrade is successful.
*/
public function testFilledUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
}
}
@@ -29,7 +29,7 @@ class UserUpdatePathTestCase extends UpdatePathTestCase {
* Tests that the update is successful.
*/
public function testFilledUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The update was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The update was completed successfully.');
$this->assertTrue(db_index_exists('users', 'picture'), 'The {users}.picture column has an index.');
}
}
@@ -27,6 +27,6 @@ class CommentUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testCommentUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
}
}
@@ -28,20 +28,20 @@ class FilterFormatUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
function testFilterFormatUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$format = filter_format_load('1');
$this->assertTrue($format->format == '1', t('Filter format found.'));
$this->assertTrue($format->format == '1', 'Filter format found.');
$format->format = 'test_filter';
$format->name = 'Test filter';
filter_format_save($format);
$format = filter_format_load('test_filter');
$this->assertTrue($format->format == 'test_filter', t('Saved a filter format with machine name.'));
$this->assertTrue($format->format == 'test_filter', 'Saved a filter format with machine name.');
$account = user_load(4);
user_save($account, array('signature_format' => 'test_filter'));
$account = user_load(4);
$this->assertTrue($account->signature_format == 'test_filter', t('Signature format changed successfully to a filter format with machine name.'));
$this->assertTrue($account->signature_format == 'test_filter', 'Signature format changed successfully to a filter format with machine name.');
$delta = db_insert('block_custom')
->fields(array(
@@ -50,6 +50,6 @@ class FilterFormatUpgradePathTestCase extends UpgradePathTestCase {
'format' => 'test_filter',
))
->execute();
$this->assertTrue($delta > 0, t('Created a custom block using a filter format with machine name.'));
$this->assertTrue($delta > 0, 'Created a custom block using a filter format with machine name.');
}
}
@@ -27,7 +27,7 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testForumUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Work around http://drupal.org/node/931512
$this->drupalPost('admin/structure/types/manage/forum/fields', array(), t('Save'));
@@ -47,11 +47,11 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase {
);
$this->drupalPost("node/add/forum/$tid", $edit, t('Save'));
$type = t('Forum topic');
$this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was created'));
$this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), 'Forum topic was created');
// Retrieve node object, ensure that the topic was created and in the proper forum.
$node = $this->drupalGetNodeByTitle($title);
$this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title)));
$this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
$this->assertEqual($node->taxonomy_forums[LANGUAGE_NONE][0]['tid'], $tid, 'Saved forum topic was in the expected forum');
$this->drupalGet("forum/$tid");
@@ -59,6 +59,6 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase {
$this->drupalLogout();
$this->drupalGet("node/add/forum/$tid");
$this->assertResponse(200, t('User can access forum creation page.'));
$this->assertResponse(200, 'User can access forum creation page.');
}
}
@@ -27,7 +27,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testLocaleUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The home page should be in French.
$this->assertPageInLanguage('', 'fr');
@@ -46,13 +46,13 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
// LANGUAGE_NEGOTIATION_PATH_DEFAULT.
$this->variable_set('language_negotiation', 1);
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The home page should be in French.
$this->assertPageInLanguage('', 'fr');
// The language switcher block should be displayed.
$this->assertRaw('block-locale-language', t('The language switcher block is displayed.'));
$this->assertRaw('block-locale-language', 'The language switcher block is displayed.');
// The French prefix should not be active because French is the default language.
$this->drupalGet('fr');
@@ -75,7 +75,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
->condition('uid', 1)
->execute();
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Both prefixes should be active.
$this->assertPageInLanguage('fr', 'fr');
@@ -85,7 +85,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
$this->assertPageInLanguage('', 'en');
// The language switcher block should be displayed.
$this->assertRaw('block-locale-language', t('The language switcher block is displayed.'));
$this->assertRaw('block-locale-language', 'The language switcher block is displayed.');
}
/**
@@ -95,13 +95,13 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
// LANGUAGE_NEGOTIATION_DOMAIN.
$this->variable_set('language_negotiation', 3);
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The home page should be in French.
$this->assertPageInLanguage('', 'fr');
// The language switcher block should be displayed.
$this->assertRaw('block-locale-language', t('The language switcher block is displayed.'));
$this->assertRaw('block-locale-language', 'The language switcher block is displayed.');
// The language switcher block should point to http://en.example.com.
$language_links = $this->xpath('//ul[contains(@class, :class)]/li/a', array(':class' => 'language-switcher-locale-url'));
@@ -111,7 +111,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
$found_english_link = TRUE;
}
}
$this->assertTrue($found_english_link, t('The English link points to the correct domain.'));
$this->assertTrue($found_english_link, 'The English link points to the correct domain.');
// Both prefixes should be inactive.
$this->drupalGet('en');
@@ -27,7 +27,7 @@ class MenuUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testMenuUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Test the migration of "Default menu for content" setting to individual
// node types.
@@ -26,7 +26,7 @@ class NodeBodyUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testNodeBodyUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$instance = field_info_instance('node', 'body', 'story');
$this->assertIdentical($instance['required'], 0, 'The required setting was preserved during the upgrade path.');
@@ -77,7 +77,7 @@ class DisabledNodeTypeTestCase extends UpgradePathTestCase {
* Tests a successful upgrade.
*/
public function testDisabledNodeTypeUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->assertTrue(field_info_instance('comment', 'comment_body', 'comment_node_broken'), 'Comment body field instance was created for comments attached to the disabled broken node type');
}
}
@@ -114,7 +114,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testPollUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Check modules page for poll
$this->drupalGet('admin/modules');
@@ -126,14 +126,14 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
$nbchoices = ($i % 4) + 2;
for ($c = 0; $c < $nbchoices; $c++) {
$this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on poll view'));
$this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on poll view');
}
// Now check that the votes are correct
$this->clickLink(t('Results'));
for ($c = 0; $c < $nbchoices; $c++) {
$this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on result view'));
$this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on result view');
}
$nbvotes = floor (($i % 4) + 5);
@@ -141,7 +141,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
for ($c = 0; $c < $nbchoices; $c++) {
$votes = floor($nbvotes / $nbchoices);
if (($nbvotes % $nbchoices) > $c) $votes++;
$this->assertTrue(preg_match("/$votes vote/", $elements[$c]), t('The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]));
$this->assertTrue(preg_match("/$votes vote/", $elements[$c]), 'The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]);
}
}
}
@@ -32,7 +32,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testPollUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Check modules page for poll
$this->drupalGet('admin/modules');
@@ -44,14 +44,14 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
$nbchoices = ($i % 4) + 2;
for ($c = 0; $c < $nbchoices; $c++) {
$this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on poll view'));
$this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on poll view');
}
// Now check that the votes are correct
$this->clickLink(t('Results'));
for ($c = 0; $c < $nbchoices; $c++) {
$this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on result view'));
$this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on result view');
}
$nbvotes = floor (($i % 4) + 5);
@@ -59,7 +59,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
for ($c = 0; $c < $nbchoices; $c++) {
$votes = floor($nbvotes / $nbchoices);
if (($nbvotes % $nbchoices) > $c) $votes++;
$this->assertTrue(preg_match("/$votes vote/", $elements[$c]), t('The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]));
$this->assertTrue(preg_match("/$votes vote/", $elements[$c]), 'The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]);
}
}
}
@@ -46,15 +46,20 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
* Basic tests for the taxonomy upgrade.
*/
public function testTaxonomyUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Visit the front page to assert for PHP warning and errors.
$this->drupalGet('');
// Check that taxonomy_vocabulary_node_type and taxonomy_term_node have been
// removed.
$this->assertFalse(db_table_exists('taxonomy_vocabulary_node_type'), t('taxonomy_vocabulary_node_type has been removed.'));
$this->assertFalse(db_table_exists('taxonomy_term_node'), t('taxonomy_term_node has been removed.'));
$this->assertFalse(db_table_exists('taxonomy_vocabulary_node_type'), 'taxonomy_vocabulary_node_type has been removed.');
$this->assertFalse(db_table_exists('taxonomy_term_node'), 'taxonomy_term_node has been removed.');
// Check that taxonomy_index has not stored nids of unpublished nodes.
$nids = db_query('SELECT nid from {node} WHERE status = :status', array(':status' => NODE_NOT_PUBLISHED))->fetchCol();
$indexed_nids = db_query('SELECT DISTINCT nid from {taxonomy_index}')->fetchCol();
$this->assertFalse(array_intersect($nids, $indexed_nids), 'No unpublished nid present in taxonomy_index');
// Check that the node type 'page' has been associated to a taxonomy
// reference field for each vocabulary.
@@ -66,12 +71,13 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
$inst_keys = array_keys($instances);
sort($voc_keys);
sort($inst_keys);
$this->assertEqual($voc_keys, $inst_keys, t('Node type page has instances for every vocabulary.'));
$this->assertEqual($voc_keys, $inst_keys, 'Node type page has instances for every vocabulary.');
// Ensure instance variables are getting through.
foreach ($instances as $instance) {
$this->assertTrue(isset($instance['required']), 'The required setting was preserved during the upgrade path.');
$this->assertTrue($instance['description'], 'The description was preserved during the upgrade path');
foreach (array_unique($instances) as $instance) {
$field_instance = field_info_instance('node', $instance, 'page');
$this->assertTrue(isset($field_instance['required']), 'The required setting was preserved during the upgrade path.');
$this->assertTrue($field_instance['description'], 'The description was preserved during the upgrade path');
}
// Node type 'story' was not explicitly in $vocabulary->nodes but
@@ -80,13 +86,13 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
// the taxonomyextra field.
$instances = $this->instanceVocabularies('node', 'story');
$field_names = array_flip($instances);
$this->assertEqual(count($field_names), 1, t('Only one taxonomy term field instance exists for story nodes'));
$this->assertEqual(key($field_names), 'taxonomyextra', t('Only the excess taxonomy term field is used on story nodes'));
$this->assertEqual(count($field_names), 1, 'Only one taxonomy term field instance exists for story nodes');
$this->assertEqual(key($field_names), 'taxonomyextra', 'Only the excess taxonomy term field is used on story nodes');
// Check that the node type 'poll' has been associated to no taxonomy
// reference field.
$instances = $this->instanceVocabularies('node', 'poll');
$this->assertTrue(empty($instances), t('Node type poll has no taxonomy term reference field instances.'));
$this->assertTrue(empty($instances), 'Node type poll has no taxonomy term reference field instances.');
// Check that each node of type 'page' and 'story' is associated to all the
// terms except terms whose ID is equal to the node ID or is equal to the
@@ -147,14 +153,14 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
if (!$should_be_displayed) {
// Look for any link with the term path.
$links = $this->xpath('//a[@href=:term_path]', array(':term_path' => $term_path));
$this->assertFalse($links, t('Term %name (@field) is not displayed on node %nid', $args));
$this->assertFalse($links, format_string('Term %name (@field) is not displayed on node %nid', $args));
}
else {
// Look for a link with the term path inside the correct field.
// We search for "SPACE + class + SPACE" to avoid matching a substring
// of the class.
$links = $this->xpath('//div[contains(concat(" ", normalize-space(@class), " "), :field_class)]//a[@href=:term_path]', array(':field_class' => ' ' . $field_class . ' ', ':term_path' => $term_path));
$this->assertTrue($links, t('Term %name (@field) is displayed on node %nid', $args));
$this->assertTrue($links, format_string('Term %name (@field) is displayed on node %nid', $args));
}
}
@@ -162,7 +168,7 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
// ID 0. Make sure we ignored this instead of generating a bogus term.
if ($node->nid == 1) {
$link = l($term->name, 'taxonomy/term/0');
$this->assertNoRaw($link, t('Bogus term (tid 0) is not displayed on node 1 vid %old_vid.', $args));
$this->assertNoRaw($link, format_string('Bogus term (tid 0) is not displayed on node 1 vid %old_vid.', $args));
}
// The first 12 nodes have two revisions. For nodes with
@@ -170,7 +176,7 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
// to terms whose ID is equal to the node ID or 49 less the node ID.
$revisions = node_revision_list($node);
if ($node->nid < 13) {
$this->assertEqual(count($revisions), 2, t('Node %nid has two revisions.', $args));
$this->assertEqual(count($revisions), 2, format_string('Node %nid has two revisions.', $args));
$last_rev = end($revisions);
$args['%old_vid'] = $last_rev->vid;
@@ -183,13 +189,13 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
$term = $terms[$node->nid];
$link = l($term->name, 'taxonomy/term/' . $term->tid);
$this->assertRaw($link, t('Term %name (@field) is displayed on node %nid vid %old_vid.', $args));
$this->assertRaw($link, format_string('Term %name (@field) is displayed on node %nid vid %old_vid.', $args));
$term = $terms[49-$node->nid];
$link = l($term->name, 'taxonomy/term/' . $term->tid);
$this->assertRaw($link, t('Term %name (@field) is displayed on node %nid %old_vid.', $args));
$this->assertRaw($link, format_string('Term %name (@field) is displayed on node %nid %old_vid.', $args));
}
else {
$this->assertEqual(count($revisions), 1, t('Node %nid has one revision.', $args));
$this->assertEqual(count($revisions), 1, format_string('Node %nid has one revision.', $args));
}
}
}
+23 -23
View File
@@ -256,7 +256,7 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
// Check if there still are pending updates.
$this->drupalGet($update_url, array('external' => TRUE));
$this->drupalPost(NULL, array(), t('Continue'));
if (!$this->assertText(t('No pending updates.'), t('No pending updates at the end of the update process.'))) {
if (!$this->assertText(t('No pending updates.'), 'No pending updates at the end of the update process.')) {
return FALSE;
}
@@ -358,14 +358,14 @@ class BasicUpgradePath extends UpgradePathTestCase {
// Destroy a table that the upgrade process needs.
db_drop_table('access');
// Assert that the upgrade fails.
$this->assertFalse($this->performUpgrade(FALSE) && $this->pendingUpdates, t('A failed upgrade should return messages.'));
$this->assertFalse($this->performUpgrade(FALSE) && $this->pendingUpdates, 'A failed upgrade should return messages.');
}
/**
* Test a successful upgrade.
*/
public function testBasicUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -374,7 +374,7 @@ class BasicUpgradePath extends UpgradePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -394,7 +394,7 @@ class BasicUpgradePath extends UpgradePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal 6', t('The site name is correctly displayed.'));
$this->assertText('Drupal 6', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -408,11 +408,11 @@ class BasicUpgradePath extends UpgradePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
// Test that the environment after the upgrade is in a consistent status.
$update_d6 = variable_get('update_d6', FALSE);
$this->assertFalse($update_d6, t('The D6 upgrade flag variable has been correctly disabled.'));
$this->assertFalse($update_d6, 'The D6 upgrade flag variable has been correctly disabled.');
}
}
@@ -446,7 +446,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase {
* Tests a successful point release update.
*/
public function testBasicStandardUpdate() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -455,7 +455,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -475,7 +475,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal', t('The site name is correctly displayed.'));
$this->assertText('Drupal', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -489,7 +489,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
}
}
@@ -522,7 +522,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
* Tests a successful point release update.
*/
public function testBasicMinimalUpdate() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -531,7 +531,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -551,7 +551,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal', t('The site name is correctly displayed.'));
$this->assertText('Drupal', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -565,7 +565,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
// Confirm that a date format that just differs in the case can be added.
$admin_date_format = 'j M y';
@@ -613,7 +613,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase {
* Tests a successful point release update.
*/
public function testFilledStandardUpdate() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -622,7 +622,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -642,7 +642,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal', t('The site name is correctly displayed.'));
$this->assertText('Drupal', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -656,7 +656,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
}
}
@@ -689,7 +689,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase {
* Tests a successful point release update.
*/
public function testFilledStandardUpdate() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -698,7 +698,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -718,7 +718,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal', t('The site name is correctly displayed.'));
$this->assertText('Drupal', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -732,6 +732,6 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
}
}
@@ -28,7 +28,7 @@ class TranslatableUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testTranslatableUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The D6 database contains the english node "First translatable page" with
// nid 53.
@@ -39,12 +39,12 @@ class TranslatableUpgradePathTestCase extends UpgradePathTestCase {
// Check whether the node displays properly.
$this->drupalGet("node/$nid");
$this->assertText($body, t('Translatable node body displays properly'));
$this->assertText($body, 'Translatable node body displays properly');
// Retrieve node object, ensure that both the body and the teaser has
// survived upgrade properly.
$node = $this->drupalGetNodeByTitle($title);
$this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title)));
$this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
$this->assertEqual($node->body[LANGUAGE_NONE][0]['value'], $body, 'Body of the node survived upgrade properly');
$this->assertEqual($node->body[LANGUAGE_NONE][0]['summary'], $teaser, 'Teaser of the node survived upgrade properly');
}
@@ -29,7 +29,7 @@ class UpgradePathTriggerTestCase extends UpgradePathTestCase {
* Basic tests for the trigger upgrade.
*/
public function testTaxonomyUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->drupalGet('admin/structure/trigger/node');
$this->assertRaw('<td>'. t('Make post sticky') .'</td>');
$this->assertRaw('<td>'. t('Publish post') .'</td>');
@@ -29,7 +29,7 @@ class UploadUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testUploadUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query->entityCondition('bundle', 'page');
@@ -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';