test random image block
This commit is contained in:
parent
f0b9f8909d
commit
cf6a533c74
1 changed files with 36 additions and 0 deletions
|
@ -15,5 +15,41 @@ class RandomTest extends ShimmieWebTestCase {
|
|||
# FIXME: test random_image/download
|
||||
# FIXME: test random_image/ratio=4:3/download
|
||||
}
|
||||
|
||||
function tesPostListBlock() {
|
||||
$this->log_in_as_admin();
|
||||
$this->get_page("setup");
|
||||
$this->set_field("_config_show_random_block", true);
|
||||
$this->click("Save Settings");
|
||||
$this->log_out();
|
||||
|
||||
# enabled, no image = no text
|
||||
$this->get_page("post/list");
|
||||
$this->assert_no_text("Random Image");
|
||||
|
||||
$this->log_in_as_user();
|
||||
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "test");
|
||||
$this->log_out();
|
||||
|
||||
# enabled, image = text
|
||||
$this->get_page("post/list");
|
||||
$this->assert_text("Random Image");
|
||||
|
||||
$this->log_in_as_admin();
|
||||
$this->get_page("setup");
|
||||
$this->set_field("_config_show_random_block", true);
|
||||
$this->click("Save Settings");
|
||||
|
||||
# disabled, image = no text
|
||||
$this->get_page("post/list");
|
||||
$this->assert_text("Random Image");
|
||||
|
||||
$this->delete_image($image_id);
|
||||
$this->log_out();
|
||||
|
||||
# disabled, no image = no image
|
||||
$this->get_page("post/list");
|
||||
$this->assert_no_text("Random Image");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
Reference in a new issue