forked from Cavemanon/cavepaintings
PSR-2. I'm not a huge fan, but ugly consistency beats no consistency...
This commit is contained in:
@ -1,57 +1,59 @@
|
||||
<?php
|
||||
class RandomTest extends ShimmiePHPUnitTestCase {
|
||||
public function testRandom() {
|
||||
$this->log_in_as_user();
|
||||
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test");
|
||||
$this->log_out();
|
||||
class RandomTest extends ShimmiePHPUnitTestCase
|
||||
{
|
||||
public function testRandom()
|
||||
{
|
||||
$this->log_in_as_user();
|
||||
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test");
|
||||
$this->log_out();
|
||||
|
||||
$this->get_page("random_image/view");
|
||||
$this->assert_title("Image $image_id: test");
|
||||
$this->get_page("random_image/view");
|
||||
$this->assert_title("Image $image_id: test");
|
||||
|
||||
$this->get_page("random_image/view/test");
|
||||
$this->assert_title("Image $image_id: test");
|
||||
$this->get_page("random_image/view/test");
|
||||
$this->assert_title("Image $image_id: test");
|
||||
|
||||
$this->get_page("random_image/download");
|
||||
# FIXME: assert($raw == file(blah.jpg))
|
||||
}
|
||||
$this->get_page("random_image/download");
|
||||
# FIXME: assert($raw == file(blah.jpg))
|
||||
}
|
||||
|
||||
public function testPostListBlock() {
|
||||
$this->log_in_as_admin();
|
||||
$this->get_page("setup");
|
||||
public function testPostListBlock()
|
||||
{
|
||||
$this->log_in_as_admin();
|
||||
$this->get_page("setup");
|
||||
|
||||
$this->markTestIncomplete();
|
||||
$this->markTestIncomplete();
|
||||
|
||||
$this->set_field("_config_show_random_block", true);
|
||||
$this->click("Save Settings");
|
||||
$this->log_out();
|
||||
$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");
|
||||
# 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("tests/pbx_screenshot.jpg", "test");
|
||||
$this->log_out();
|
||||
$this->log_in_as_user();
|
||||
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test");
|
||||
$this->log_out();
|
||||
|
||||
# enabled, image = text
|
||||
$this->get_page("post/list");
|
||||
$this->assert_text("Random Image");
|
||||
# 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");
|
||||
$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");
|
||||
# disabled, image = no text
|
||||
$this->get_page("post/list");
|
||||
$this->assert_text("Random Image");
|
||||
|
||||
$this->delete_image($image_id);
|
||||
$this->log_out();
|
||||
$this->delete_image($image_id);
|
||||
$this->log_out();
|
||||
|
||||
# disabled, no image = no image
|
||||
$this->get_page("post/list");
|
||||
$this->assert_no_text("Random Image");
|
||||
}
|
||||
# disabled, no image = no image
|
||||
$this->get_page("post/list");
|
||||
$this->assert_no_text("Random Image");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user