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/featured/test.php
2015-09-20 22:40:04 +01:00

34 lines
870 B
PHP

<?php
class FeaturedTest extends ShimmiePHPUnitTestCase {
function testFeatured() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
# FIXME: test that regular users can't feature things
$this->log_in_as_admin();
$this->get_page("post/view/$image_id");
$this->assert_title("Image $image_id: pbx");
return; // FIXME
$this->click("Feature This");
$this->get_page("post/list");
$this->assert_text("Featured Image");
# FIXME: test changing from one feature to another
$this->get_page("featured_image/download");
$this->assert_response(200);
$this->get_page("featured_image/view");
$this->assert_response(200);
$this->delete_image($image_id);
$this->log_out();
# after deletion, there should be no feature
$this->get_page("post/list");
$this->assert_no_text("Featured Image");
}
}