You are here

function TriggerContentTestCase::actionInfo in Drupal 7

Returns some info about each of the content actions.

This is helper function for testActionsContent().

Parameters

$action: The name of the action to return info about.

Return value

An associative array of info about the action.

1 call to TriggerContentTestCase::actionInfo()
TriggerContentTestCase::testActionsContent in modules/trigger/trigger.test
Tests several content-oriented trigger issues.

File

modules/trigger/trigger.test, line 149
Tests for trigger.module.

Class

TriggerContentTestCase
Provides tests for node triggers.

Code

function actionInfo($action) {
  $info = array(
    'node_publish_action' => array(
      'property' => 'status',
      'expected' => 1,
      'name' => t('publish content'),
    ),
    'node_unpublish_action' => array(
      'property' => 'status',
      'expected' => 0,
      'name' => t('unpublish content'),
    ),
    'node_make_sticky_action' => array(
      'property' => 'sticky',
      'expected' => 1,
      'name' => t('make content sticky'),
    ),
    'node_make_unsticky_action' => array(
      'property' => 'sticky',
      'expected' => 0,
      'name' => t('make content unsticky'),
    ),
    'node_promote_action' => array(
      'property' => 'promote',
      'expected' => 1,
      'name' => t('promote content to front page'),
    ),
    'node_unpromote_action' => array(
      'property' => 'promote',
      'expected' => 0,
      'name' => t('remove content from front page'),
    ),
  );
  return $info[$action];
}