update.aggregator.test

Tests schema changes in aggregator.module.

Classes

Namesort descending Description
AggregatorUpdatePathTestCase @file Tests schema changes in aggregator.module.

File

drupal/modules/simpletest/tests/upgrade/update.aggregator.test
View source
  1. <?php
  2. /**
  3. * @file
  4. * Tests schema changes in aggregator.module.
  5. */
  6. class AggregatorUpdatePathTestCase extends UpdatePathTestCase {
  7. public static function getInfo() {
  8. return array(
  9. 'name' => 'Aggregator update path',
  10. 'description' => 'Aggregator update path tests.',
  11. 'group' => 'Upgrade path',
  12. );
  13. }
  14. public function setUp() {
  15. // Use the normal installation and add our feed data.
  16. $path = drupal_get_path('module', 'simpletest') . '/tests/upgrade';
  17. $this->databaseDumpFiles = array(
  18. $path . '/drupal-7.bare.standard_all.database.php.gz',
  19. $path . '/drupal-7.aggregator.database.php',
  20. );
  21. parent::setUp();
  22. // Our test data only relies on aggregator.module.
  23. $this->uninstallModulesExcept(array('aggregator'));
  24. }
  25. /**
  26. * Tests that the aggregator.module update is successful.
  27. */
  28. public function testAggregatorUpdate() {
  29. // Get a selection of the fields affected by the schema update.
  30. $query = db_select('aggregator_feed', 'af');
  31. $query->join('aggregator_item', 'ai', 'af.fid = ai.fid');
  32. $query
  33. ->fields('af', array('url', 'link'))
  34. ->fields('ai', array('link', 'guid'));
  35. $pre_update_data = $query->execute()->fetchAll();
  36. $this->assertTrue($this->performUpgrade(), 'The update was completed successfully.');
  37. $post_update_data = $query->execute()->fetchAll();
  38. $this->assertTrue($pre_update_data == $post_update_data, 'Feed data was preserved during the update.');
  39. }
  40. }