pager_example.test

  1. examples
    1. 7 pager_example/pager_example.test
    2. 8 pager_example/pager_example.test

Simpletest case for pager_example module.

Classes

NameDescription
PagerExampleTestCaseFunctionality tests for the pager example module.

File

pager_example/pager_example.test
View source
  1. <?php
  2. // $Id$
  3. /**
  4. * @file
  5. * Simpletest case for pager_example module.
  6. */
  7. /**
  8. * Functionality tests for the pager example module.
  9. */
  10. class PagerExampleTestCase extends DrupalWebTestCase {
  11. public static function getInfo() {
  12. return array(
  13. 'name' => 'Pager Example',
  14. 'description' => 'Verify the pager functionality',
  15. 'group' => 'Examples',
  16. );
  17. }
  18. function setUp() {
  19. // Enable the module.
  20. parent::setUp('pager_example');
  21. }
  22. /**
  23. * Verify the functionality of the example module.
  24. */
  25. function testPagerPage() {
  26. // no need to login for this test
  27. $this->drupalGet('examples/pager_example');
  28. $this->assertText('next', 'Found next link');
  29. $this->assertText('last', 'Found last link');
  30. // on the first page we shouldn't see the first
  31. // or previous links
  32. $this->assertNoText('first', 'No first link on the first page');
  33. $this->assertNoText('previous', 'No previous link on the first page');
  34. // lets go to the second page
  35. $this->drupalGet('examples/pager_example', array('query' => array('page' => 1)));
  36. $this->assertText('next', 'Found next link');
  37. $this->assertText('last', 'Found last link');
  38. // on the second page we should also see the first
  39. // and previous links
  40. $this->assertText('first', 'Found first link');
  41. $this->assertText('previous', 'Found previous link');
  42. }
  43. }
Login or register to post comments