You are here

protected function ViewsRulesBaseTestCase::createSiteData in Views Rules 7

Creates site objects.

5 calls to ViewsRulesBaseTestCase::createSiteData()
ViewsRulesCollectActionTestCase::testCollector in tests/views_rules.test
Tests data collector.
ViewsRulesCollectActionTestCase::testEvaluate in tests/views_rules.test
Tests evaluating the action.
ViewsRulesViewLoopTestCase::testEvaluate in tests/views_rules.test
Tests evaluation of a view loop.
ViewsRulesViewLoopTestCase::testImport in tests/views_rules.test
Tests importing a view loop.
ViewsRulesViewsDisplayTestCase::testExecuteIterator in tests/views_rules.test
Tests iterator evaluation.

File

tests/views_rules.test, line 14
Simpletest implementations.

Class

ViewsRulesBaseTestCase
Base test for Views Rules.

Code

protected function createSiteData() {
  $data = array();

  // Create sample items.
  $vocabulary = taxonomy_vocabulary_machine_name_load('tags');
  $data['term'] = (object) array(
    'name' => 'Term 1',
    'vid' => $vocabulary->vid,
    'vocabulary_machine_name' => 'tags',
  );
  taxonomy_term_save($data['term']);
  $nodeBase = array(
    'type' => 'article',
    'language' => LANGUAGE_NONE,
    'field_tags' => array(
      LANGUAGE_NONE => array(
        array(
          'tid' => $data['term']->tid,
        ),
      ),
    ),
  );
  $data['node1'] = $this
    ->drupalCreateNode(array(
    'title' => 'Node 1',
  ) + $nodeBase);
  $data['node2'] = $this
    ->drupalCreateNode(array(
    'title' => 'Node 2',
  ) + $nodeBase);
  $data['node3'] = $this
    ->drupalCreateNode(array(
    'title' => 'Node 3',
  ) + $nodeBase);
  return $data;
}