This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/view/test.php

35 lines
979 B
PHP
Raw Normal View History

<?php
class ViewTest extends ShimmieWebTestCase {
function testViewPage() {
$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");
$idp1 = $image_id_2 + 1;
$this->log_out();
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");
$this->get_page("post/view/$idp1");
2009-08-19 00:28:48 +00:00
$this->assert_title('Image not found');
$this->get_page('post/view/-1');
2009-08-19 00:28:48 +00:00
$this->assert_title('Image not found');
$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);
$this->log_out();
}
}
?>