diff --git a/modules/simpletest/tests/upgrade/drupal-7.aggregator.database.php b/modules/simpletest/tests/upgrade/drupal-7.aggregator.database.php new file mode 100644 index 0000000..537f454 --- /dev/null +++ b/modules/simpletest/tests/upgrade/drupal-7.aggregator.database.php @@ -0,0 +1,150 @@ +fields(array( + 'fid', + 'title', + 'url', + 'refresh', + 'checked', + 'queued', + 'link', + 'description', + 'image', + 'hash', + 'etag', + 'modified', + 'block', +)) + ->values(array( + 'fid' => '1', + 'title' => 'Drupal commit log', + 'url' => 'http://drupal.org/commitlog/feed', + 'refresh' => '3600', + 'checked' => '1347209523', + 'queued' => '0', + 'link' => 'http://drupal.org/versioncontrol/garbage/path', + 'description' => '', + 'image' => '', + 'hash' => '84f57ae5bffa7fd56942a6293be91244d8551cd18204a7c7de6a17065ea4d54d', + 'etag' => '"1347206975"', + 'modified' => '1347206975', + 'block' => '5', +)) + ->execute(); + +db_insert('aggregator_item')->fields(array( + 'iid', + 'fid', + 'title', + 'link', + 'author', + 'description', + 'timestamp', + 'guid', +)) + ->values(array( + 'iid' => '1', + 'fid' => '1', + 'title' => 'Domain Access: Commit b904022 on 7.x-2.x authored by bforchhammer, committed by agentrickard', + 'link' => 'http://drupal.org/commitlog/commit/2%2C410/b90402243b4a9dee0d2e2c4a729dcb2f58dc53c0', + 'author' => 'bforchhammer', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 1 addition & 1 deletion\n
\n \n
\n +- \n
\n
\n
\n \n \n \n
\n 13 additions & 1 deletion\n
\n \n
\n ++++++-\n
\n
\n
\n \n \n \n \n \n \n
\n
Patch #1685658 by bforchhammer. Better handling of current domain for Domain Source.\n
", + 'timestamp' => '1347206044', + 'guid' => 'VCS Operation 3936918 at http://drupal.org', +)) + ->values(array( + 'iid' => '2', + 'fid' => '1', + 'title' => 'Video: Commit b0b7ff0 on 7.x-2.x by Jorrit', + 'link' => 'http://drupal.org/commitlog/commit/846/b0b7ff08fed89c76454aa54627cc219361365d7b', + 'author' => 'Jorrit', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 5 additions & 5 deletions\n
\n \n
\n +++--- \n
\n
\n
\n \n \n \n
\n 21 additions & 7 deletions\n
\n \n
\n +++++--\n
\n
\n
\n \n \n \n
\n 31 additions & 22 deletions\n
\n \n
\n ++++---\n
\n
\n
\n \n \n \n \n \n \n
\n
Issue #1492296 by Jorrit: Added support for avconv binaries instead of FFmpeg.\n
", + 'timestamp' => '1347206397', + 'guid' => 'VCS Operation 3936924 at http://drupal.org', +)) + ->values(array( + 'iid' => '3', + 'fid' => '1', + 'title' => 'Remove Login Tabs: Commit 6e1eb5a on 7.x-1.x by highrockmedia', + 'link' => 'http://drupal.org/commitlog/commit/41%2C610/6e1eb5a4a952db3264e7696e840ac3d797f4b477', + 'author' => 'highrockmedia', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 10 additions & 2 deletions\n
\n \n
\n ++++++-\n
\n
\n
\n \n \n \n \n \n \n
\n
Updating readme\n
", + 'timestamp' => '1347206401', + 'guid' => 'VCS Operation 3936920 at http://drupal.org', +)) + ->values(array( + 'iid' => '4', + 'fid' => '1', + 'title' => 'TimeGroup: Commit 6ed4c08 on 7.x-1.x by Sweetchuck', + 'link' => 'http://drupal.org/commitlog/commit/40%2C448/6ed4c085e5d9a8d33e091e1b8a65c73eab2dc99e', + 'author' => 'Sweetchuck', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 1 addition & 1 deletion\n
\n \n
\n +- \n
\n
\n
\n \n \n \n \n \n \n
\n
CTools UI - Wrong default value for timeoffset fix.\n
", + 'timestamp' => '1347206533', + 'guid' => 'VCS Operation 3936942 at http://drupal.org', +)) + ->values(array( + 'iid' => '5', + 'fid' => '1', + 'title' => 'Domain Access: Commit 1140172 on 6.x-2.x authored by bforchhammer, committed by agentrickard', + 'link' => 'http://drupal.org/commitlog/commit/2%2C410/11401723f5c5d11032dd141ba4939ed889a7a915', + 'author' => 'bforchhammer', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 33 additions & 1 deletion\n
\n \n
\n ++++++ \n
\n
\n
\n \n \n \n
\n 28 additions & 0 deletions\n
\n \n
\n +++++++\n
\n
\n
\n \n \n \n \n \n \n
\n
Patch #1685658 by bforchhammer. Better handling of current domain for Domain Source.\n
", + 'timestamp' => '1347206541', + 'guid' => 'VCS Operation 3936926 at http://drupal.org', +)) + ->values(array( + 'iid' => '6', + 'fid' => '1', + 'title' => 'Domain Access: Commit 19b1c36 on 7.x-2.x by agentrickard', + 'link' => 'http://drupal.org/commitlog/commit/2%2C410/19b1c366d86cecd8a9f6e1a6e835c0566f5c02db', + 'author' => 'agentrickard', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 28 additions & 0 deletions\n
\n \n
\n +++++++\n
\n
\n
\n \n \n \n \n \n \n
\n
Adds new Views file to Domain Source.\n
", + 'timestamp' => '1347206601', + 'guid' => 'VCS Operation 3936928 at http://drupal.org', +)) + ->values(array( + 'iid' => '7', + 'fid' => '1', + 'title' => 'Domain Access: Commit d2d5456 on 7.x-3.x by agentrickard', + 'link' => 'http://drupal.org/commitlog/commit/2%2C410/d2d5456cad6ca57bb72e743da6a7112a74d7a331', + 'author' => 'agentrickard', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 29 additions & 0 deletions\n
\n \n
\n +++++++\n
\n
\n
\n \n \n \n \n \n \n
\n
Adds new Views file to Domain Source.\n
", + 'timestamp' => '1347206620', + 'guid' => 'VCS Operation 3936930 at http://drupal.org', +)) + ->values(array( + 'iid' => '8', + 'fid' => '1', + 'title' => 'Skarabee: Commit 400b519 on 7.x-1.x by sboersma', + 'link' => 'http://drupal.org/commitlog/commit/23%2C278/400b5190f59b1cb58d6b27fa10ac668e9580aa73', + 'author' => 'sboersma', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 3 additions & 3 deletions\n
\n \n
\n +++--- \n
\n
\n
\n \n \n \n \n \n \n
\n
sboersma: Changed variable deletion method.\n
", + 'timestamp' => '1347206709', + 'guid' => 'VCS Operation 3936932 at http://drupal.org', +)) + ->values(array( + 'iid' => '9', + 'fid' => '1', + 'title' => 'Config entity listing plugin API: Commit dd3fa73 on 8.x-list by damiankloip', + 'link' => 'http://drupal.org/commitlog/commit/43%2C586/dd3fa73b0bcdca833bbde1d1ddb3cefe42003693', + 'author' => 'damiankloip', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 10 additions & 2 deletions\n
\n \n
\n ++++++-\n
\n
\n
\n \n \n \n \n \n \n
\n
Added tests for getList() method\n
", + 'timestamp' => '1347206738', + 'guid' => 'VCS Operation 3936936 at http://drupal.org', +)) + ->values(array( + 'iid' => '10', + 'fid' => '1', + 'title' => 'AutoSlave: Commit 76891da on 7.x-1.x by gielfeldt', + 'link' => 'http://drupal.org/commitlog/commit/42%2C968/76891daf3cea9c294daf56a26760cb1bf33ea58a', + 'author' => 'gielfeldt', + 'description' => "
\n \n \n \n
\n
\n \n \n \n
\n 10 additions & 7 deletions\n
\n \n
\n ++++---\n
\n
\n
\n \n \n \n
\n 10 additions & 2 deletions\n
\n \n
\n ++++++-\n
\n
\n
\n \n \n \n \n \n \n
\n
Keep track of affected tables per commit.\n
", + 'timestamp' => '1347206751', + 'guid' => 'VCS Operation 3936934 at http://drupal.org', +)) + ->execute(); + diff --git a/modules/simpletest/tests/upgrade/update.aggregator.test b/modules/simpletest/tests/upgrade/update.aggregator.test new file mode 100644 index 0000000..51aa2cb --- /dev/null +++ b/modules/simpletest/tests/upgrade/update.aggregator.test @@ -0,0 +1,46 @@ + 'Aggregator update path', + 'description' => 'Aggregator update path tests.', + 'group' => 'Upgrade path', + ); + } + + public function setUp() { + // Use the normal installation and add our feed data. + $path = drupal_get_path('module', 'simpletest') . '/tests/upgrade'; + $this->databaseDumpFiles = array( + $path . '/drupal-7.bare.standard_all.database.php.gz', + $path . '/drupal-7.aggregator.database.php', + ); + parent::setUp(); + + // Our test data only relies on aggregator.module. + $this->uninstallModulesExcept(array('aggregator')); + } + + /** + * Tests that the aggregator.module update is successful. + */ + public function testAggregatorUpdate() { + // Get a selection of the fields affected by the schema update. + $query = db_select('aggregator_feed', 'af'); + $query->join('aggregator_item', 'ai', 'af.fid = ai.fid'); + $query + ->fields('af', array('url', 'link')) + ->fields('ai', array('link', 'guid')); + + $pre_update_data = $query->execute()->fetchAll(); + $this->assertTrue($this->performUpgrade(), t('The update was completed successfully.')); + $post_update_data = $query->execute()->fetchAll(); + + $this->assertTrue($pre_update_data == $post_update_data, 'Feed data was preserved during the update.'); + } + +}