summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/upgrade.filter.test
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2014-01-29 15:00:00 (GMT)
committerTorsten Grote <grote@kolabsys.com>2014-01-29 15:00:00 (GMT)
commitd9e4a0f1b5f45b2e3fed0908a69dad264d40b15b (patch)
tree76d774e7d2ce4ba7c0754c590a6b730b6f6ceed9 /kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/upgrade.filter.test
parent5145fb6b6b03f545d7b82db89850dac1b3b49d78 (diff)
downloadkolab.org-www-d9e4a0f1b5f45b2e3fed0908a69dad264d40b15b.tar.gz
add new drupal version
Diffstat (limited to 'kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/upgrade.filter.test')
-rw-r--r--kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/upgrade.filter.test55
1 files changed, 55 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/upgrade.filter.test b/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/upgrade.filter.test
new file mode 100644
index 0000000..584f4d9
--- /dev/null
+++ b/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/upgrade.filter.test
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * 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(), 'The upgrade was completed successfully.');
+
+ $format = filter_format_load('1');
+ $this->assertTrue($format->format == '1', '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', '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', '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, 'Created a custom block using a filter format with machine name.');
+ }
+}