summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-03-26 21:56:50 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-03-26 21:56:50 -0700
commit505974084d248ebcbb225fe328409ef59a9d4e5a (patch)
tree6fcb33d4dce25fb1c7100c4aed823b8b1ced674a /modules/simpletest
parent039a66c042b6c6667fff5108b59fcec2eb5f7cff (diff)
downloadbrdo-505974084d248ebcbb225fe328409ef59a9d4e5a.tar.gz
brdo-505974084d248ebcbb225fe328409ef59a9d4e5a.tar.bz2
Issue #1280792 by xjm, julien, BTMash, pingers, AntoineSolutions, tim.plunkett, Niklas Fiekas: Fixed {trigger_assignments()}.hook has only 32 characters, is too short.
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/simpletest.info1
-rw-r--r--modules/simpletest/tests/upgrade/drupal-6.trigger.database.php76
-rw-r--r--modules/simpletest/tests/upgrade/upgrade.trigger.test34
3 files changed, 111 insertions, 0 deletions
diff --git a/modules/simpletest/simpletest.info b/modules/simpletest/simpletest.info
index 6a02cf965..0a43eb35b 100644
--- a/modules/simpletest/simpletest.info
+++ b/modules/simpletest/simpletest.info
@@ -46,6 +46,7 @@ files[] = tests/upgrade/upgrade.locale.test
files[] = tests/upgrade/upgrade.menu.test
files[] = tests/upgrade/upgrade.node.test
files[] = tests/upgrade/upgrade.taxonomy.test
+files[] = tests/upgrade/upgrade.trigger.test
files[] = tests/upgrade/upgrade.translatable.test
files[] = tests/upgrade/update.trigger.test
files[] = tests/upgrade/upgrade.upload.test
diff --git a/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php b/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
new file mode 100644
index 000000000..07160d9ec
--- /dev/null
+++ b/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @file
+ * Test content for the trigger upgrade path.
+ */
+db_create_table('trigger_assignments', array(
+ 'fields' => array(
+ 'hook' => array(
+ 'type' => 'varchar',
+ 'length' => 32,
+ 'not null' => TRUE,
+ 'default' => '',
+ ),
+ 'op' => array(
+ 'type' => 'varchar',
+ 'length' => 32,
+ 'not null' => TRUE,
+ 'default' => '',
+ ),
+ 'aid' => array(
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
+ 'default' => '',
+ ),
+ 'weight' => array(
+ 'type' => 'int',
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ ),
+ 'primary key' => array('hook', 'op', 'aid'),
+ 'module' => 'trigger',
+ 'name' => 'trigger_assignments',
+));
+
+
+// Add several trigger configurations.
+db_insert('trigger_assignments')->fields(array(
+ 'hook',
+ 'op',
+ 'aid',
+ 'weight',
+))
+->values(array(
+ 'hook' => 'node',
+ 'op' => 'presave',
+ 'aid' => 'node_publish_action',
+ 'weight' => '1',
+))
+->values(array(
+ 'hook' => 'comment',
+ 'op' => 'presave',
+ 'aid' => 'comment_publish_action',
+ 'weight' => '1',
+))
+->values(array(
+ 'hook' => 'comment_delete',
+ 'op' => 'presave',
+ 'aid' => 'node_save_action',
+ 'weight' => '1',
+))
+->values(array(
+ 'hook' => 'nodeapi',
+ 'op' => 'somehow_nodeapi_got_a_very_long',
+ 'aid' => 'node_save_action',
+ 'weight' => '1',
+))
+->execute();
+
+db_update('system')->fields(array(
+ 'schema_version' => '6000',
+ 'status' => '1',
+))
+->condition('filename', 'modules/trigger/trigger.module')
+->execute();
diff --git a/modules/simpletest/tests/upgrade/upgrade.trigger.test b/modules/simpletest/tests/upgrade/upgrade.trigger.test
new file mode 100644
index 000000000..028ea4f05
--- /dev/null
+++ b/modules/simpletest/tests/upgrade/upgrade.trigger.test
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @file
+ * Provides upgrade path tests for the Trigger module.
+ */
+
+/**
+ * Tests the Trigger 6 -> 7 upgrade path.
+ */
+class UpgradePathTriggerTestCase extends UpgradePathTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Trigger upgrade path',
+ 'description' => 'Trigger upgrade path tests.',
+ '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',
+ drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.trigger.database.php',
+ );
+ parent::setUp();
+ }
+
+ /**
+ * Basic tests for the trigger upgrade.
+ */
+ public function testTaxonomyUpgrade() {
+ $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+ }
+}