summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php')
-rw-r--r--kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php82
1 files changed, 82 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php b/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
new file mode 100644
index 0000000..0962f35
--- /dev/null
+++ b/kolab.org/www/drupal-7.26/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
@@ -0,0 +1,82 @@
+<?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' => 'presave',
+ 'aid' => 'node_make_sticky_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();