Projet

Général

Profil

Révision 582db59d

Ajouté par Assos Assos il y a plus de 8 ans

Update Drupal core to version 7.40

Voir les différences:

drupal7/modules/simpletest/tests/upgrade/upgrade.upload.test
64 64
      }
65 65
      $this->assertIdentical($filenames, $recorded_filenames, 'The uploaded files are present in the same order after the upgrade.');
66 66
    }
67

  
67 68
    // Test for the file with repeating basename to only have the streaming
68 69
    // path replaced.
69 70
    $node = node_load(40, 53);
70 71
    $repeated_basename_file = $node->upload[LANGUAGE_NONE][4];
71 72
    $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");
72 73

  
74
    // Ensure that filepaths are deduplicated.
75
    $node0 = node_load(41, 54);
76
    $node1 = node_load(41, 55);
77
    // Ensure that both revisions point to the same file ID.
78
    $items0 = field_get_items('node', $node0, 'upload');
79
    $this->assertEqual(count($items0), 1);
80
    $items1 = field_get_items('node', $node1, 'upload');
81
    $this->assertEqual(count($items1), 2);
82
    $this->assertEqual($items0[0]['fid'], $items1[0]['fid']);
83
    $this->assertEqual($items0[0]['fid'], $items1[1]['fid']);
84
    // The revision with more than one reference to the same file should retain
85
    // the original settings for each reference.
86
    $this->assertEqual($items1[0]['description'], 'first description');
87
    $this->assertEqual($items1[0]['display'], 0);
88
    $this->assertEqual($items1[1]['description'], 'second description');
89
    $this->assertEqual($items1[1]['display'], 1);
90
    // Ensure that the latest version of the files are used.
91
    $this->assertEqual($items1[0]['filesize'], 316);
92
    $this->assertEqual($items1[1]['filesize'], 316);
93
    // No duplicate files should remain on the Drupal 7 site.
94
    $this->assertEqual(0, db_query("SELECT COUNT(*) FROM {file_managed} GROUP BY uri HAVING COUNT(fid) > 1")->fetchField());
95

  
73 96
    // Make sure the file settings were properly migrated.
74 97
    $d6_file_directory_temp = '/drupal-6/file/directory/temp';
75 98
    $d6_file_directory_path = '/drupal-6/file/directory/path';

Formats disponibles : Unified diff