test the next and prev buttons

This commit is contained in:
Shish 2009-09-19 20:19:09 +01:00
parent 6726f13603
commit d7038a0098

View File

@ -2,12 +2,22 @@
class ViewTest extends ShimmieWebTestCase { class ViewTest extends ShimmieWebTestCase {
function testViewPage() { function testViewPage() {
$this->log_in_as_user(); $this->log_in_as_user();
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "test"); $image_id_1 = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "test");
$idp1 = $image_id + 1; $image_id_2 = $this->post_image("ext/simpletest/data/bedroom_workshop.jpg", "test2");
$idp1 = $image_id_2 + 1;
$this->log_out(); $this->log_out();
$this->get_page("post/view/$image_id"); $this->get_page("post/view/$image_id_1");
$this->assert_title("Image $image_id: test"); $this->assert_title("Image $image_id_1: test");
$this->click("Prev");
$this->assert_title("Image $image_id_2: test2");
$this->click("Next");
$this->assert_title("Image $image_id_1: test");
$this->click("Next");
$this->assert_title("Image not found");
$this->get_page("post/view/$idp1"); $this->get_page("post/view/$idp1");
$this->assert_title('Image not found'); $this->assert_title('Image not found');
@ -16,7 +26,8 @@ class ViewTest extends ShimmieWebTestCase {
$this->assert_title('Image not found'); $this->assert_title('Image not found');
$this->log_in_as_admin(); $this->log_in_as_admin();
$this->delete_image($image_id); $this->delete_image($image_id_1);
$this->delete_image($image_id_2);
$this->log_out(); $this->log_out();
} }
} }