You are here

protected function ViewsRulesViewLoopTestCase::createTestComponent in Views Rules 7

Creates an action set to test a view loop.

2 calls to ViewsRulesViewLoopTestCase::createTestComponent()
ViewsRulesViewLoopTestCase::testEvaluate in tests/views_rules.test
Tests evaluation of a view loop.
ViewsRulesViewLoopTestCase::testExport in tests/views_rules.test
Tests exporting a view loop.

File

tests/views_rules.test, line 298
Simpletest implementations.

Class

ViewsRulesViewLoopTestCase
Rules plugin tests.

Code

protected function createTestComponent() {
  $variables = array(
    'term' => array(
      'type' => 'taxonomy_term',
      'label' => 'Term',
    ),
    'list' => array(
      'type' => 'list',
      'label' => 'List',
      'parameter' => FALSE,
    ),
  );
  $provides = array(
    'list',
  );
  $loop = views_rules_loop('views_rules_test', 'views_rules_1', array(
    'tid:select' => 'term:tid',
    'type' => 'article',
    'nid:var' => 'nid',
    'nid:label' => 'Node ID',
    'title:var' => 'title',
    'title:label' => 'Title',
  ));
  return rules_action_set($variables, $provides)
    ->action($loop
    ->action('list_add', array(
    'list:select' => 'list',
    'item:select' => 'title',
  )));
}