You are here

function ViewsLimitGroupingTests::setUp in Views Grouping Row Limit 7

Overrides parent::setUp().

Create our initial content types and nodes.

Overrides DrupalWebTestCase::setUp

File

tests/views_limit_grouping.test, line 34
Contains test for views_limit_grouping module.

Class

ViewsLimitGroupingTests
Functional test class for views_limit_grouping.

Code

function setUp() {

  // Enable our test module. It contains all of our default views.
  parent::setUp('views_limit_grouping_test');
  for ($i = 1; $i <= self::CONTENT_TYPE_AMOUNT; $i++) {
    $type = $this
      ->drupalCreateContentType(array(
      'type' => 'content_type_' . $i,
      'name' => 'Content Type ' . $i,
    ));
    $this->content_types[$type->type] = $type;
  }
  $this
    ->assertEqual(count($this->content_types), self::CONTENT_TYPE_AMOUNT, t('Content types created'));

  // Make a bunch of nodes for each content type.
  foreach (array_keys($this->content_types) as $type) {
    for ($i = 0; $i < self::NODES_PER_CONTENT_TYPE; $i++) {
      $this->nodes[$type][] = $this
        ->drupalCreateNode(array(
        'type' => $type,
      ));
    }
    $this
      ->assertEqual(count($this->nodes[$type]), self::NODES_PER_CONTENT_TYPE, t('Nodes for content type %type created', array(
      '%type' => $this->content_types[$type]->name,
    )));
  }
}