Simpletest case for pager_example module.
Classes
| Name | Description |
|---|---|
| PagerExampleTestCase | Functionality tests for the pager example module. |
File
pager_example/pager_example.testView source
- <?php
- // $Id$
- /**
- * @file
- * Simpletest case for pager_example module.
- */
-
- /**
- * Functionality tests for the pager example module.
- */
- class PagerExampleTestCase extends DrupalWebTestCase {
-
- public static function getInfo() {
- return array(
- 'name' => 'Pager Example',
- 'description' => 'Verify the pager functionality',
- 'group' => 'Examples',
- );
- }
-
- function setUp() {
- // Enable the module.
- parent::setUp('pager_example');
- }
-
- /**
- * Verify the functionality of the example module.
- */
- function testPagerPage() {
- // no need to login for this test
- $this->drupalGet('examples/pager_example');
- $this->assertText('next', 'Found next link');
- $this->assertText('last', 'Found last link');
-
- // on the first page we shouldn't see the first
- // or previous links
- $this->assertNoText('first', 'No first link on the first page');
- $this->assertNoText('previous', 'No previous link on the first page');
-
- // lets go to the second page
- $this->drupalGet('examples/pager_example', array('query' => array('page' => 1)));
- $this->assertText('next', 'Found next link');
- $this->assertText('last', 'Found last link');
-
- // on the second page we should also see the first
- // and previous links
- $this->assertText('first', 'Found first link');
- $this->assertText('previous', 'Found previous link');
- }
- }
-