[ticket/9341] Follow the Next/Prev link in tests

follow the next/prev link and then assert if the page contains
its last post or not

PHPBB3-9341
This commit is contained in:
Dhruv 2013-06-28 00:52:36 +05:30
parent 69001902b9
commit 22998ee5ee

View file

@ -23,11 +23,15 @@ class phpbb_functional_paging_test extends phpbb_functional_test_case
$this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post no' . $post_id . ' posted by the testing framework.');
}
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
$link = $crawler->filter('#viewtopic > fieldset > a')->attr('href');
$crawler = self::request('GET', $link);
$this->assertContains('post no9', $crawler->text());
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}&start=10");
$link = $crawler->filter('#viewtopic > fieldset > a')->attr('href');
$crawler = self::request('GET', $link);
$next_link = $crawler->filter('#viewtopic > fieldset > a.arrow-right')->attr('href');
$crawler = self::request('GET', $next_link);
$this->assertContains('post no19', $crawler->text());
$prev_link = $crawler->filter('#viewtopic > fieldset > a.arrow-left')->attr('href');
$crawler = self::request('GET', $prev_link);
$this->assertContains('post no9', $crawler->text());
}
}