2008-10-11 07:09:42 +00:00
|
|
|
<?php
|
2009-07-15 01:42:18 +00:00
|
|
|
class ViewTest extends ShimmieWebTestCase {
|
2008-10-11 07:09:42 +00:00
|
|
|
function testViewPage() {
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->log_in_as_user();
|
2009-09-19 19:19:09 +00:00
|
|
|
$image_id_1 = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "test");
|
|
|
|
$image_id_2 = $this->post_image("ext/simpletest/data/bedroom_workshop.jpg", "test2");
|
2010-03-08 18:25:23 +00:00
|
|
|
$image_id_3 = $this->post_image("ext/simpletest/data/favicon.png", "test");
|
|
|
|
$idp1 = $image_id_3 + 1;
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->log_out();
|
2008-10-11 07:09:42 +00:00
|
|
|
|
2009-09-19 19:19:09 +00:00
|
|
|
$this->get_page("post/view/$image_id_1");
|
|
|
|
$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");
|
2009-07-15 01:42:18 +00:00
|
|
|
|
|
|
|
$this->get_page("post/view/$idp1");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title('Image not found');
|
2008-10-11 07:09:42 +00:00
|
|
|
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->get_page('post/view/-1');
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title('Image not found');
|
2009-07-15 01:42:18 +00:00
|
|
|
|
2010-03-08 18:25:23 +00:00
|
|
|
# note: skips image #2
|
2012-03-09 18:56:06 +00:00
|
|
|
$this->get_page("post/view/$image_id_1?search=test"); // FIXME: assumes niceurls
|
2010-03-08 18:29:53 +00:00
|
|
|
$this->click("Prev");
|
2010-03-08 18:25:23 +00:00
|
|
|
$this->assert_title("Image $image_id_3: test");
|
|
|
|
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->log_in_as_admin();
|
2009-09-19 19:19:09 +00:00
|
|
|
$this->delete_image($image_id_1);
|
|
|
|
$this->delete_image($image_id_2);
|
2010-03-23 04:30:33 +00:00
|
|
|
$this->delete_image($image_id_3);
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->log_out();
|
2008-10-11 07:09:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|