You are here

function rules_test_rules_condition_info in Rules 7.2

Same name and namespace in other branches
  1. 6 rules_test/rules_test.rules.inc \rules_test_rules_condition_info()

Implements hook_rules_condition_info().

File

tests/rules_test.rules.inc, line 30
Includes any rules integration provided by the module.

Code

function rules_test_rules_condition_info() {
  $items = array();
  $defaults = array(
    'parameter' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('Content'),
      ),
    ),
    'group' => t('Node'),
  );
  $items['rules_condition_content_is_type'] = array(
    'label' => t('Content has type'),
    'parameter' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('Content'),
      ),
      'type' => array(
        'type' => 'list<text>',
        'label' => t('Content types'),
      ),
    ),
    'help' => t('Evaluates to TRUE, if the given content has one of the selected content types.'),
  ) + $defaults;
  $items['rules_condition_content_is_published'] = $defaults + array(
    'label' => t('Content is published'),
  );
  $items['rules_test_condition_true'] = array(
    'label' => t('Test condition returning true'),
    'group' => t('Rules test'),
  );
  $items['rules_test_condition_false'] = array(
    'label' => t('Test condition returning false'),
    'group' => t('Rules test'),
  );
  $items['rules_test_condition_apostrophe'] = array(
    'label' => t("Test use of an apostrophe (') in a condition label"),
    'group' => t('Rules test'),
  );

  // A condition for testing passing entities wrapped.
  $items['rules_test_condition_node_wrapped'] = array(
    'label' => t('Content is published'),
    'parameter' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('Content'),
        'wrapped' => TRUE,
      ),
    ),
    'group' => t('Node'),
  );
  return $items;
}