You are here

protected function ViewsRulesViewLoopTestCase::createTestNonFieldComponent in Views Rules 7

Creates an action set to test a view loop for a non-field view.

1 call to ViewsRulesViewLoopTestCase::createTestNonFieldComponent()
ViewsRulesViewLoopTestCase::testEvaluate in tests/views_rules.test
Tests evaluation of a view loop.

File

tests/views_rules.test, line 326
Simpletest implementations.

Class

ViewsRulesViewLoopTestCase
Rules plugin tests.

Code

protected function createTestNonFieldComponent() {
  $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_non_field_test', 'views_rules_1', array(
    'tid:select' => 'term:tid',
    'node:var' => 'node',
    'node:label' => 'Node',
  ));
  return rules_action_set($variables, $provides)
    ->action($loop
    ->action('list_add', array(
    'list:select' => 'list',
    'item:select' => 'node:title',
  )));
}