PSR-2. I'm not a huge fan, but ugly consistency beats no consistency...

This commit is contained in:
Shish
2019-05-28 17:59:38 +01:00
parent 5ec3e89884
commit 34b05cca7c
295 changed files with 27094 additions and 24632 deletions

View File

@ -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");
}
}