You are here

function ViewsLimitGroupingTests::testSimpleGroupingLimitWithOffset in Views Grouping Row Limit 7

Test a single level of grouping with offset.

File

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

Class

ViewsLimitGroupingTests
Functional test class for views_limit_grouping.

Code

function testSimpleGroupingLimitWithOffset() {
  $this
    ->drupalGet('group-by-content-type-with-offset');

  // Get the nodes manually so that we can tell if the offset happened.
  $nodes = db_query('SELECT type, title FROM {node} ORDER BY created')
    ->fetchAll();
  $groups = array();
  foreach ($nodes as $node) {
    $groups[$node->type][] = $node->title;
  }
  foreach ($groups as $type => $titles) {
    $this
      ->assertNoText($titles[0], 'The first item was not present on the page');
    $this
      ->assertText($titles[1], 'The second item was present on the page');
  }
}