? .git ? .gitignore ? 934050-75_tests.patch ? sites/default/files ? sites/default/settings.php Index: modules/simpletest/simpletest.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.info,v retrieving revision 1.25 diff -u -p -r1.25 simpletest.info --- modules/simpletest/simpletest.info 15 Oct 2010 03:36:21 -0000 1.25 +++ modules/simpletest/simpletest.info 20 Oct 2010 22:13:06 -0000 @@ -41,6 +41,7 @@ files[] = tests/update.test files[] = tests/xmlrpc.test files[] = tests/upgrade/upgrade.test files[] = tests/upgrade/upgrade.comment.test +files[] = tests/upgrade/upgrade.filter.test files[] = tests/upgrade/upgrade.node.test files[] = tests/upgrade/upgrade.taxonomy.test files[] = tests/upgrade/upgrade.upload.test Index: modules/simpletest/tests/upgrade/upgrade.filter.test =================================================================== RCS file: modules/simpletest/tests/upgrade/upgrade.filter.test diff -N modules/simpletest/tests/upgrade/upgrade.filter.test --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/upgrade/upgrade.filter.test 20 Oct 2010 22:13:06 -0000 @@ -0,0 +1,56 @@ + 'Filter format upgrade path', + 'description' => 'Verifies that filter formats and references to filter formats are converted properly.', + 'group' => 'Upgrade path', + ); + } + + public 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. + */ + public 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.')); + } +}