t('Pager test'), 'desc' => t('Create 20 promoted nodes and check the first two pages.'), 'group' => 'Node Tests', ); } function testPageCreation() { $title = '!SimpleTest test node! ' . $this->randomName(10); $body = '!SimpleTest test body! ' . $this->randomName(32) . ' ' . $this->randomName(32); for ($i = 0; $i< 20; $i++) { $this->drupalCreateNode(array('title' => $title . "!$i!", 'promote' => 1, 'sticky' => $i)); } $map = array( array('method' => 'assertNoText', 'method1' => 'assertText', 'text' => 'first page, not found', 'text1' => 'first page, found'), array('method' => 'assertText', 'method1' => 'assertNoText', 'text' => 'second page, found', 'text1' => 'second page, not found'), ); for ($j = 0; $j < 2; $j++) { $this->drupalGet(url('node', array('absolute' => TRUE, 'query' => "page=$j"))); $this->assertTrue(TRUE, 'On page: '. $this->getUrl()); $method = $map[$j]['method']; $text = $map[$j]['text']; for ($i = 0; $i < 20; $i++) { $this->$method($title. "!$i!", $text . $i); if ($i == 9) { $method = $map[$j]['method1']; $text = $map[$j]['text1']; } } } } }