aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/paging_test.php
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-06-28 00:52:36 +0530
committerDhruv <dhruv.goel92@gmail.com>2013-06-28 00:52:36 +0530
commit22998ee5ee2d3cb4b0e3e34083b2876ab1e9bfb1 (patch)
treea353f3ac5b316f7eb1a1d98a7fa88e4b0ed7e178 /tests/functional/paging_test.php
parent69001902b98f66c8bf4c21df5920d2b070aa9a71 (diff)
downloadforums-22998ee5ee2d3cb4b0e3e34083b2876ab1e9bfb1.tar
forums-22998ee5ee2d3cb4b0e3e34083b2876ab1e9bfb1.tar.gz
forums-22998ee5ee2d3cb4b0e3e34083b2876ab1e9bfb1.tar.bz2
forums-22998ee5ee2d3cb4b0e3e34083b2876ab1e9bfb1.tar.xz
forums-22998ee5ee2d3cb4b0e3e34083b2876ab1e9bfb1.zip
[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
Diffstat (limited to 'tests/functional/paging_test.php')
-rw-r--r--tests/functional/paging_test.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/functional/paging_test.php b/tests/functional/paging_test.php
index d2e52ccf09..d85ce49aa6 100644
--- a/tests/functional/paging_test.php
+++ b/tests/functional/paging_test.php
@@ -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());
}
}