Projet

Général

Profil

Paste
Télécharger (1,46 ko) Statistiques
| Branche: | Révision:

root / drupal7 / modules / simpletest / tests / upgrade / update.aggregator.test @ f7a2490e

1
<?php
2
/**
3
 * @file
4
 * Tests schema changes in aggregator.module.
5
 */
6
class AggregatorUpdatePathTestCase extends UpdatePathTestCase {
7

    
8
  public static function getInfo() {
9
    return array(
10
      'name' => 'Aggregator update path',
11
      'description' => 'Aggregator update path tests.',
12
      'group' => 'Upgrade path',
13
    );
14
  }
15

    
16
  public function setUp() {
17
    // Use the normal installation and add our feed data.
18
    $path = drupal_get_path('module', 'simpletest') . '/tests/upgrade';
19
    $this->databaseDumpFiles = array(
20
      $path . '/drupal-7.bare.standard_all.database.php.gz',
21
      $path . '/drupal-7.aggregator.database.php',
22
    );
23
    parent::setUp();
24

    
25
    // Our test data only relies on aggregator.module.
26
    $this->uninstallModulesExcept(array('aggregator'));
27
  }
28

    
29
  /**
30
   * Tests that the aggregator.module update is successful.
31
   */
32
  public function testAggregatorUpdate() {
33
    // Get a selection of the fields affected by the schema update.
34
    $query = db_select('aggregator_feed', 'af');
35
    $query->join('aggregator_item', 'ai', 'af.fid = ai.fid');
36
    $query
37
      ->fields('af', array('url', 'link'))
38
      ->fields('ai', array('link', 'guid'));
39

    
40
    $pre_update_data = $query->execute()->fetchAll();
41
    $this->assertTrue($this->performUpgrade(), 'The update was completed successfully.');
42
    $post_update_data = $query->execute()->fetchAll();
43

    
44
    $this->assertTrue($pre_update_data == $post_update_data, 'Feed data was preserved during the update.');
45
  }
46

    
47
}