2008-10-11 07:09:42 +00:00
|
|
|
<?php
|
2009-07-15 02:42:18 +01:00
|
|
|
class ViewTest extends ShimmieWebTestCase {
|
2008-10-11 07:09:42 +00:00
|
|
|
function testViewPage() {
|
2009-07-15 02:42:18 +01:00
|
|
|
$this->log_in_as_user();
|
|
|
|
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "test");
|
|
|
|
$idp1 = $image_id + 1;
|
|
|
|
$this->log_out();
|
2008-10-11 07:09:42 +00:00
|
|
|
|
2009-07-15 02:42:18 +01:00
|
|
|
$this->get_page("post/view/$image_id");
|
2009-08-19 01:28:48 +01:00
|
|
|
$this->assert_title("Image $image_id: test");
|
2009-07-15 02:42:18 +01:00
|
|
|
|
|
|
|
$this->get_page("post/view/$idp1");
|
2009-08-19 01:28:48 +01:00
|
|
|
$this->assert_title('Image not found');
|
2008-10-11 07:09:42 +00:00
|
|
|
|
2009-07-15 02:42:18 +01:00
|
|
|
$this->get_page('post/view/-1');
|
2009-08-19 01:28:48 +01:00
|
|
|
$this->assert_title('Image not found');
|
2009-07-15 02:42:18 +01:00
|
|
|
|
|
|
|
$this->log_in_as_admin();
|
|
|
|
$this->delete_image($image_id);
|
|
|
|
$this->log_out();
|
2008-10-11 07:09:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|