summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/update.field.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/update.field.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/update.field.test')
-rw-r--r--kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/update.field.test61
1 files changed, 61 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/update.field.test b/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/update.field.test
new file mode 100644
index 0000000..a4b11c3
--- /dev/null
+++ b/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/update.field.test
@@ -0,0 +1,61 @@
+<?php
+
+/**
+ * @file
+ * Provides update path tests for the Field module.
+ */
+
+/**
+ * Tests the Field 7.0 -> 7.x update path.
+ */
+class FieldUpdatePathTestCase extends UpdatePathTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Field update path',
+ 'description' => 'Field update path tests.',
+ 'group' => 'Upgrade path',
+ );
+ }
+
+ public function setUp() {
+ // Use the filled update path and our field data.
+ $path = drupal_get_path('module', 'simpletest') . '/tests/upgrade';
+ $this->databaseDumpFiles = array(
+ $path . '/drupal-7.filled.standard_all.database.php.gz',
+ $path . '/drupal-7.field.database.php',
+ );
+ parent::setUp();
+
+ // Our test data includes poll extra field settings.
+ $this->uninstallModulesExcept(array('field', 'poll'));
+ }
+
+ /**
+ * Tests that the update is successful.
+ */
+ public function testFilledUpgrade() {
+ $this->assertTrue($this->performUpgrade(), 'The update was completed successfully.');
+ $expected_settings = array(
+ 'extra_fields' => array(
+ 'display' => array(
+ 'poll_view_voting' => array(
+ 'default' => array(
+ 'weight' => '0',
+ 'visible' => TRUE,
+ ),
+ ),
+ 'poll_view_results' => array(
+ 'default' => array(
+ 'weight' => '0',
+ 'visible' => FALSE,
+ ),
+ ),
+ ),
+ 'form' => array(),
+ ),
+ 'view_modes' => array(),
+ );
+ $actual_settings = field_bundle_settings('node', 'poll');
+ $this->assertEqual($expected_settings, $actual_settings, 'Settings stored in field_bundle_settings were updated to per-bundle settings.');
+ }
+}