diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-09 17:43:10 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-09 17:43:10 +0000 |
commit | f1515c957c16c06d7d7be53f36f273b643b4cd52 (patch) | |
tree | 46699cf9510a6c0a0780eb347f7537ecbe91d1b9 | |
parent | 297eb72f2dcc461c4ae50ed784d8e74439539dd2 (diff) | |
download | brdo-f1515c957c16c06d7d7be53f36f273b643b4cd52.tar.gz brdo-f1515c957c16c06d7d7be53f36f273b643b4cd52.tar.bz2 |
#934050 follow-up: Committing missing tests.
-rw-r--r-- | modules/simpletest/tests/upgrade/upgrade.filter.test | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/simpletest/tests/upgrade/upgrade.filter.test b/modules/simpletest/tests/upgrade/upgrade.filter.test new file mode 100644 index 000000000..732e757e7 --- /dev/null +++ b/modules/simpletest/tests/upgrade/upgrade.filter.test @@ -0,0 +1,56 @@ +<?php +// $Id$ + +/** + * Upgrade test for filter format identifiers. + * + * Filter format identifiers changed from sequential ids to machine names. + * Verify that filter formats and references to filter formats in core are + * converted properly. + */ +class FilterFormatUpgradePathTestCase extends UpgradePathTestCase { + public static function getInfo() { + return array( + 'name' => 'Filter format upgrade path', + 'description' => 'Verifies that filter formats and references to filter formats are converted properly.', + 'group' => 'Upgrade path', + ); + } + + function setUp() { + // Path to the database dump. + $this->databaseDumpFiles = array( + drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php', + ); + parent::setUp(); + } + + /** + * Test a successful upgrade. + */ + function testFilterFormatUpgrade() { + $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + + $format = filter_format_load('1'); + $this->assertTrue($format->format == '1', t('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.')); + + $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.')); + + $delta = db_insert('block_custom') + ->fields(array( + 'body' => 'Test block', + 'info' => 'Test block', + 'format' => 'test_filter', + )) + ->execute(); + $this->assertTrue($delta > 0, t('Created a custom block using a filter format with machine name.')); + } +} |