You are here

public function ViewsPagerTest::testRenderNullPager in Views (for Drupal 7) 7.3

Tests rendering with NULL pager.

File

tests/views_pager.test, line 452
Definition of ViewsPagerTest.

Class

ViewsPagerTest
Tests the pluggable pager system.

Code

public function testRenderNullPager() {

  // Create 11 nodes and make sure that everyone is returned. We create 11
  // nodes, because the default pager plugin had 10 items per page.
  for ($i = 0; $i < 11; $i++) {
    $this
      ->drupalCreateNode();
  }
  $view = $this
    ->viewsPagerFullFields();
  $view
    ->set_display('default');
  $this
    ->executeView($view);
  $view->use_ajax = TRUE;

  // force the value again here.
  $view->query->pager = NULL;
  $output = $view
    ->render();
  $this
    ->assertEqual(preg_match('/<ul class="pager">/', $output), 0, t('The pager is not rendered.'));
}