summaryrefslogtreecommitdiff
path: root/modules/trigger/trigger.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/trigger/trigger.test')
-rw-r--r--modules/trigger/trigger.test30
1 files changed, 29 insertions, 1 deletions
diff --git a/modules/trigger/trigger.test b/modules/trigger/trigger.test
index 2df6fe01d..ca56ad85f 100644
--- a/modules/trigger/trigger.test
+++ b/modules/trigger/trigger.test
@@ -45,7 +45,7 @@ class TriggerContentTestCase extends TriggerWebTestCase {
}
function setUp() {
- parent::setUp('trigger');
+ parent::setUp('trigger', 'trigger_test');
}
/**
@@ -100,6 +100,34 @@ class TriggerContentTestCase extends TriggerWebTestCase {
}
/**
+ * Test that node actions are fired for each node individually if acting on
+ * multiple nodes.
+ */
+ function testActionContentMultiple() {
+ // Assign an action to the node save/update trigger.
+ $test_user = $this->drupalCreateUser(array('administer actions', 'administer nodes', 'create page content', 'access administration pages', 'access content overview'));
+ $this->drupalLogin($test_user);
+
+ for ($index = 0; $index < 3; $index++) {
+ $edit = array('title' => $this->randomName());
+ $this->drupalPost('node/add/page', $edit, t('Save'));
+ }
+
+ $action_id = 'trigger_test_generic_any_action';
+ $hash = md5($action_id);
+ $edit = array('aid' => $hash);
+ $this->drupalPost('admin/structure/trigger/node', $edit, t('Assign'));
+
+ $edit = array(
+ 'operation' => 'unpublish',
+ 'nodes[1]' => TRUE,
+ 'nodes[2]' => TRUE,
+ );
+ $this->drupalPost('admin/content', $edit, t('Update'));
+ $this->assertTrue(variable_get('trigger_test_generic_any_action', 0) == 2, 'Action was triggered 2 times.');
+ }
+
+ /**
* Helper function for testActionsContent(): returns some info about each of the content actions.
*
* @param $action