7.x actions.test ActionLoopTestCase::testActionLoop()

Set up a loop with 3 - 12 recursions, and see if it aborts properly.

File

modules/simpletest/tests/actions.test, line 85

Class

ActionLoopTestCase
Test actions executing in a potential loop, and make sure they abort properly.

Code

function testActionLoop() {
  $user = $this
    ->drupalCreateUser(array(
    'administer actions',
  ));
  $this
    ->drupalLogin($user);
  $hash = drupal_hash_base64('actions_loop_test_log');
  $edit = array(
    'aid' => $hash,
  );
  $this
    ->drupalPost('admin/structure/trigger/actions_loop_test', $edit, t('Assign'));

  // Delete any existing watchdog messages to clear the plethora of
  // "Action added" messages from when Drupal was installed.
  db_delete('watchdog')
    ->execute();

  // To prevent this test from failing when xdebug is enabled, the maximum
  // recursion level should be kept low enough to prevent the xdebug
  // infinite recursion protection mechanism from aborting the request.
  // See http://drupal.org/node/587634.
  variable_set('actions_max_stack', 7);
  $this
    ->triggerActions();
}