mark tests as public

This commit is contained in:
Shish 2015-09-26 11:17:13 +01:00
parent c54e336695
commit 8c1e3bc92a
49 changed files with 97 additions and 97 deletions

View File

@ -1,6 +1,6 @@
<?php
class AdminPageTest extends ShimmiePHPUnitTestCase {
function testAuth() {
public function testAuth() {
$this->get_page('admin');
$this->assert_response(403);
$this->assert_title("Permission Denied");
@ -16,7 +16,7 @@ class AdminPageTest extends ShimmiePHPUnitTestCase {
$this->assert_title("Admin Tools");
}
function testLowercase() {
public function testLowercase() {
$ts = time(); // we need a tag that hasn't been used before
$this->log_in_as_admin();
@ -37,7 +37,7 @@ class AdminPageTest extends ShimmiePHPUnitTestCase {
}
# FIXME: make sure the admin tools actually work
function testRecount() {
public function testRecount() {
$this->log_in_as_admin();
$this->get_page('admin');
$this->assert_title("Admin Tools");
@ -46,7 +46,7 @@ class AdminPageTest extends ShimmiePHPUnitTestCase {
send_event(new AdminActionEvent('recount_tag_use'));
}
function testDump() {
public function testDump() {
$this->log_in_as_admin();
$this->get_page('admin');
$this->assert_title("Admin Tools");
@ -57,7 +57,7 @@ class AdminPageTest extends ShimmiePHPUnitTestCase {
//$this->assert_response(200);
}
function testDBQ() {
public function testDBQ() {
$this->log_in_as_user();
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "test");
$image_id_2 = $this->post_image("tests/bedroom_workshop.jpg", "test2");

View File

@ -1,12 +1,12 @@
<?php
class AliasEditorTest extends ShimmiePHPUnitTestCase {
function testAliasList() {
public function testAliasList() {
$this->get_page('alias/list');
$this->assert_response(200);
$this->assert_title("Alias List");
}
function testAliasListReadOnly() {
public function testAliasListReadOnly() {
// Check that normal users can't add aliases.
$this->log_in_as_user();
$this->get_page('alias/list');
@ -14,7 +14,7 @@ class AliasEditorTest extends ShimmiePHPUnitTestCase {
$this->assert_no_text("Add");
}
function testAliasEditor() {
public function testAliasEditor() {
/*
**********************************************************************
* FIXME: TODO:

View File

@ -1,6 +1,6 @@
<?php
class ArtistTest extends ShimmiePHPUnitTestCase {
function testSearch() {
public function testSearch() {
# FIXME: check that the results are there
$this->get_page("post/list/author=bob/1");
#$this->assert_response(200);

View File

@ -1,6 +1,6 @@
<?php
class BanWordsTest extends ShimmiePHPUnitTestCase {
function check_blocked($image_id, $words) {
public function check_blocked($image_id, $words) {
global $user;
try {
send_event(new CommentPostingEvent($image_id, $user, $words));
@ -11,7 +11,7 @@ class BanWordsTest extends ShimmiePHPUnitTestCase {
}
}
function testWordBan() {
public function testWordBan() {
global $config;
$config->set_string("banned_words", "viagra\nporn\n\n/http:.*\.cn\//");

View File

@ -1,6 +1,6 @@
<?php
class BlocksTest extends ShimmiePHPUnitTestCase {
function testBlocks() {
public function testBlocks() {
$this->log_in_as_admin();
$this->get_page("blocks/list");
$this->assert_response(200);

View File

@ -1,13 +1,13 @@
<?php
class BlotterTest extends ShimmiePHPUnitTestCase {
function testLogin() {
public function testLogin() {
$this->log_in_as_admin();
//$this->assert_text("Blotter Editor");
//$this->click("Blotter Editor");
//$this->log_out();
}
function testDenial() {
public function testDenial() {
$this->get_page("blotter/editor");
$this->assert_response(403);
$this->get_page("blotter/add");
@ -16,7 +16,7 @@ class BlotterTest extends ShimmiePHPUnitTestCase {
$this->assert_response(403);
}
function testAddViewRemove() {
public function testAddViewRemove() {
$this->log_in_as_admin();
$this->get_page("blotter/editor");

View File

@ -1,6 +1,6 @@
<?php
class BookmarksTest extends ShimmiePHPUnitTestCase {
function testBookmarks() {
public function testBookmarks() {
$this->get_page("bookmark/add");
$this->get_page("bookmark/remove");
}

View File

@ -1,6 +1,6 @@
<?php
class BrowserSearchTest extends ShimmiePHPUnitTestCase {
function testBasic() {
public function testBasic() {
$this->get_page("browser_search/please_dont_use_this_tag_as_it_would_break_stuff__search.xml");
$this->get_page("browser_search/test");
}

View File

@ -1,6 +1,6 @@
<?php
class BulkAddTest extends ShimmiePHPUnitTestCase {
function testBulkAdd() {
public function testBulkAdd() {
$this->log_in_as_admin();
$this->get_page('admin');

View File

@ -1,19 +1,19 @@
<?php
class CommentListTest extends ShimmiePHPUnitTestCase {
function setUp() {
public function setUp() {
global $config;
parent::setUp();
$config->set_int("comment_limit", 100);
$this->log_out();
}
function tearDown() {
public function tearDown() {
global $config;
$config->set_int("comment_limit", 10);
parent::tearDown();
}
function testCommentsPage() {
public function testCommentsPage() {
global $user;
$this->log_in_as_user();
@ -85,7 +85,7 @@ class CommentListTest extends ShimmiePHPUnitTestCase {
$this->assert_no_text('ASDFASDF');
}
function testSingleDel() {
public function testSingleDel() {
$this->markTestIncomplete();
$this->log_in_as_admin();

View File

@ -1,6 +1,6 @@
<?php
class DanbooruApiTest extends ShimmiePHPUnitTestCase {
function testSearch() {
public function testSearch() {
$this->log_in_as_admin();
$image_id = $this->post_image("tests/bedroom_workshop.jpg", "data");

View File

@ -1,11 +1,11 @@
<?php
class DowntimeTest extends ShimmiePHPUnitTestCase {
function tearDown() {
public function tearDown() {
global $config;
$config->set_bool("downtime", false);
}
function testDowntime() {
public function testDowntime() {
global $config;
$config->set_string("downtime_message", "brb, unit testing");

View File

@ -1,6 +1,6 @@
<?php
class EmoticonTest extends ShimmiePHPUnitTestCase {
function testEmoticons() {
public function testEmoticons() {
global $user;
$this->log_in_as_user();

View File

@ -1,6 +1,6 @@
<?php
class ETTest extends ShimmiePHPUnitTestCase {
function testET() {
public function testET() {
$this->log_in_as_admin();
$this->get_page("system_info");
$this->assert_title("System Info");

View File

@ -1,6 +1,6 @@
<?php
class ExtManagerTest extends ShimmiePHPUnitTestCase {
function testAuth() {
public function testAuth() {
$this->get_page('ext_manager');
$this->assert_title("Extensions");

View File

@ -1,6 +1,6 @@
<?php
class FavoritesTest extends ShimmiePHPUnitTestCase {
function testFavorites() {
public function testFavorites() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test");

View File

@ -1,6 +1,6 @@
<?php
class FeaturedTest extends ShimmiePHPUnitTestCase {
function testFeatured() {
public function testFeatured() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");

View File

@ -1,6 +1,6 @@
<?php
class Handle404Test extends ShimmiePHPUnitTestCase {
function test404Handler() {
public function test404Handler() {
$this->get_page('not/a/page');
// most descriptive error first
$this->assert_text("No handler could be found for the page 'not/a/page'");

View File

@ -1,6 +1,6 @@
<?php
class IcoHandlerTest extends ShimmiePHPUnitTestCase {
function testIcoHander() {
public function testIcoHander() {
$this->log_in_as_user();
$image_id = $this->post_image("lib/static/favicon.ico", "shimmie favicon");
$this->get_page("post/view/$image_id"); // test for no crash

View File

@ -1,6 +1,6 @@
<?php
class PixelHandlerTest extends ShimmiePHPUnitTestCase {
function testPixelHander() {
public function testPixelHander() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
//$this->assert_response(302);

View File

@ -1,6 +1,6 @@
<?php
class SVGHandlerTest extends ShimmiePHPUnitTestCase {
function testSVGHander() {
public function testSVGHander() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/test.svg", "something");
$this->get_page("post/view/$image_id"); // test for no crash

View File

@ -1,6 +1,6 @@
<?php
class HomeTest extends ShimmiePHPUnitTestCase {
function testHomePage() {
public function testHomePage() {
$this->get_page('home');
// FIXME: this page doesn't use blocks; need assert_data_contains

View File

@ -1,6 +1,6 @@
<?php
class HashBanTest extends ShimmiePHPUnitTestCase {
function testBan() {
public function testBan() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
$this->log_out();

View File

@ -1,6 +1,6 @@
<?php
class IndexTest extends ShimmiePHPUnitTestCase {
function testIndexPage() {
public function testIndexPage() {
$this->get_page('post/list');
$this->assert_title("Welcome to Shimmie ".VERSION);
$this->assert_no_text("Prev | Index | Next");
@ -29,7 +29,7 @@ class IndexTest extends ShimmiePHPUnitTestCase {
# FIXME: test search box
}
function testSearches() {
public function testSearches() {
$this->log_in_as_user();
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
$image_id_2 = $this->post_image("tests/bedroom_workshop.jpg", "computer bedroom workshop");

View File

@ -1,6 +1,6 @@
<?php
class IPBanTest extends ShimmiePHPUnitTestCase {
function testIPBan() {
public function testIPBan() {
$this->get_page('ip_ban/list');
$this->assert_response(403);
$this->assert_title("Permission Denied");

View File

@ -1,6 +1,6 @@
<?php
class LinkImageTest extends ShimmiePHPUnitTestCase {
function testLinkImage() {
public function testLinkImage() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pie");

View File

@ -1,6 +1,6 @@
<?php
class LogDatabaseTest extends ShimmiePHPUnitTestCase {
function testLog() {
public function testLog() {
$this->log_in_as_admin();
$this->get_page("log/view");
$this->get_page("log/view?module=core-image");

View File

@ -1,6 +1,6 @@
<?php
class NumericScoreTest extends ShimmiePHPUnitTestCase {
function testNumericScore() {
public function testNumericScore() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
$this->get_page("post/view/$image_id");

View File

@ -1,6 +1,6 @@
<?php
class OekakiTest extends ShimmiePHPUnitTestCase {
function testLog() {
public function testLog() {
$this->log_in_as_user();
$this->get_page("oekaki/create");
}

View File

@ -1,6 +1,6 @@
<?php
class PrivMsgTest extends ShimmiePHPUnitTestCase {
function testPM() {
public function testPM() {
$this->log_in_as_admin();
$this->get_page("user/test");
@ -31,7 +31,7 @@ class PrivMsgTest extends ShimmiePHPUnitTestCase {
$this->log_out();
}
function testAdminAccess() {
public function testAdminAccess() {
$this->log_in_as_admin();
$this->get_page("user/test");

View File

@ -1,6 +1,6 @@
<?php
class PoolsTest extends ShimmiePHPUnitTestCase {
function testPools() {
public function testPools() {
$this->get_page('pool/list');
$this->assert_title("Pools");

View File

@ -1,6 +1,6 @@
<?php
class RandomTest extends ShimmiePHPUnitTestCase {
function testRandom() {
public function testRandom() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test");
$this->log_out();
@ -15,7 +15,7 @@ class RandomTest extends ShimmiePHPUnitTestCase {
# FIXME: assert($raw == file(blah.jpg))
}
function testPostListBlock() {
public function testPostListBlock() {
$this->log_in_as_admin();
$this->get_page("setup");

View File

@ -1,6 +1,6 @@
<?php
class RatingTest extends ShimmiePHPUnitTestCase {
function testRating() {
public function testRating() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");

View File

@ -1,6 +1,6 @@
<?php
class RegenThumbTest extends ShimmiePHPUnitTestCase {
function testRegenThumb() {
public function testRegenThumb() {
$this->log_in_as_admin();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
$this->get_page("post/view/$image_id");

View File

@ -1,6 +1,6 @@
<?php
class ReportImageTest extends ShimmiePHPUnitTestCase {
function testReportImage() {
public function testReportImage() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
$this->get_page("post/view/$image_id");

View File

@ -1,6 +1,6 @@
<?php
class ResLimitTest extends ShimmiePHPUnitTestCase {
function testResLimitOK() {
public function testResLimitOK() {
global $config;
$config->set_int("upload_min_height", 0);
$config->set_int("upload_min_width", 0);
@ -16,7 +16,7 @@ class ResLimitTest extends ShimmiePHPUnitTestCase {
$this->assert_no_text("ratio");
}
function testResLimitSmall() {
public function testResLimitSmall() {
global $config;
$config->set_int("upload_min_height", 900);
$config->set_int("upload_min_width", 900);
@ -33,7 +33,7 @@ class ResLimitTest extends ShimmiePHPUnitTestCase {
}
}
function testResLimitLarge() {
public function testResLimitLarge() {
global $config;
$config->set_int("upload_min_height", 0);
$config->set_int("upload_min_width", 0);
@ -50,7 +50,7 @@ class ResLimitTest extends ShimmiePHPUnitTestCase {
}
function testResLimitRatio() {
public function testResLimitRatio() {
global $config;
$config->set_int("upload_min_height", -1);
$config->set_int("upload_min_width", -1);

View File

@ -1,6 +1,6 @@
<?php
class SetupTest extends ShimmiePHPUnitTestCase {
function testNiceUrlsTest() {
public function testNiceUrlsTest() {
# XXX: this only checks that the text is "ok", to check
# for a bug where it was coming out as "\nok"; it doesn't
# check that niceurls actually work
@ -9,27 +9,27 @@ class SetupTest extends ShimmiePHPUnitTestCase {
$this->assert_no_content("\n");
}
function testAuthAnon() {
public function testAuthAnon() {
$this->get_page('setup');
$this->assert_response(403);
$this->assert_title("Permission Denied");
}
function testAuthUser() {
public function testAuthUser() {
$this->log_in_as_user();
$this->get_page('setup');
$this->assert_response(403);
$this->assert_title("Permission Denied");
}
function testAuthAdmin() {
public function testAuthAdmin() {
$this->log_in_as_admin();
$this->get_page('setup');
$this->assert_title("Shimmie Setup");
$this->assert_text("General");
}
function testAdvanced() {
public function testAdvanced() {
$this->log_in_as_admin();
$this->get_page('setup/advanced');
$this->assert_title("Shimmie Setup");

View File

@ -1,6 +1,6 @@
<?php
class ShimmieApiTest extends ShimmiePHPUnitTestCase {
function testAPI() {
public function testAPI() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");

View File

@ -1,6 +1,6 @@
<?php
class SiteDescriptionTest extends ShimmiePHPUnitTestCase {
function testSiteDescription() {
public function testSiteDescription() {
global $config, $page;
$config->set_string("site_description", "A Shimmie testbed");
$this->get_page("post/list");
@ -10,7 +10,7 @@ class SiteDescriptionTest extends ShimmiePHPUnitTestCase {
);
}
function testSiteKeywords() {
public function testSiteKeywords() {
global $config, $page;
$config->set_string("site_keywords", "foo,bar,baz");
$this->get_page("post/list");

View File

@ -1,6 +1,6 @@
<?php
class XMLSitemapTest extends ShimmiePHPUnitTestCase {
function testBasic() {
public function testBasic() {
# this will implicitly check that there are no
# PHP-level error messages
$this->get_page('sitemap.xml');

View File

@ -1,6 +1,6 @@
<?php
class TagEditTest extends ShimmiePHPUnitTestCase {
function testTagEdit() {
public function testTagEdit() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
$this->get_page("post/view/$image_id");
@ -21,7 +21,7 @@ class TagEditTest extends ShimmiePHPUnitTestCase {
$this->log_out();
}
function testSourceEdit() {
public function testSourceEdit() {
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
$this->get_page("post/view/$image_id");
@ -51,7 +51,7 @@ class TagEditTest extends ShimmiePHPUnitTestCase {
/*
* FIXME: Mass Tagger seems to be broken, and this test case always fails.
*/
function testMassEdit() {
public function testMassEdit() {
$this->markTestIncomplete();
$this->log_in_as_admin();

View File

@ -1,6 +1,6 @@
<?php
class TagHistoryTest extends ShimmiePHPUnitTestCase {
function testTagHistory() {
public function testTagHistory() {
$this->log_in_as_admin();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
$this->get_page("post/view/$image_id");

View File

@ -2,7 +2,7 @@
class TagListTest extends ShimmiePHPUnitTestCase {
var $pages = array("map", "alphabetic", "popularity", "categories");
function testTagList() {
public function testTagList() {
$this->get_page('tags/map');
$this->assert_title('Tag List');
@ -18,7 +18,7 @@ class TagListTest extends ShimmiePHPUnitTestCase {
# FIXME: test that these show the right stuff
}
function testMinCount() {
public function testMinCount() {
foreach($this->pages as $page) {
$this->get_page("tags/$page?mincount=999999");
$this->assert_title("Tag List");

View File

@ -1,6 +1,6 @@
<?php
class TipsTest extends ShimmiePHPUnitTestCase {
function setUp() {
public function setUp() {
parent::setUp();
$this->log_in_as_admin();
@ -15,7 +15,7 @@ class TipsTest extends ShimmiePHPUnitTestCase {
$this->log_out();
}
function testImageless() {
public function testImageless() {
$this->log_in_as_admin();
$this->get_page("tips/list");
@ -37,7 +37,7 @@ class TipsTest extends ShimmiePHPUnitTestCase {
$this->log_out();
}
function testImaged() {
public function testImaged() {
$this->log_in_as_admin();
$this->get_page("tips/list");
@ -59,7 +59,7 @@ class TipsTest extends ShimmiePHPUnitTestCase {
$this->log_out();
}
function testDisabled() {
public function testDisabled() {
$this->log_in_as_admin();
$this->get_page("tips/list");

View File

@ -1,18 +1,18 @@
<?php
class UploadTest extends ShimmiePHPUnitTestCase {
function testUploadPage() {
public function testUploadPage() {
$this->log_in_as_user();
$this->get_page("upload");
$this->assert_title("Upload");
}
function testUpload() {
public function testUpload() {
$this->log_in_as_user();
$this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
}
function testRejectDupe() {
public function testRejectDupe() {
$this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
try {
@ -23,7 +23,7 @@ class UploadTest extends ShimmiePHPUnitTestCase {
}
}
function testRejectUnknownFiletype() {
public function testRejectUnknownFiletype() {
try {
$this->post_image("index.php", "test");
}
@ -32,7 +32,7 @@ class UploadTest extends ShimmiePHPUnitTestCase {
}
}
function testRejectHuge() {
public function testRejectHuge() {
$this->markTestIncomplete();
// FIXME: huge.dat is rejected for other reasons; manual testing shows that this works

View File

@ -1,6 +1,6 @@
<?php
class UserPageTest extends ShimmiePHPUnitTestCase {
function testUserPage() {
public function testUserPage() {
$this->get_page('user');
$this->assert_title("Not Logged In");
$this->assert_no_text("Options");

View File

@ -1,11 +1,11 @@
<?php
class ViewTest extends ShimmiePHPUnitTestCase {
function setUp() {
public function setUp() {
parent::setUp();
// FIXME: upload images
}
function testViewPage() {
public function testViewPage() {
$this->log_in_as_user();
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "test");
$image_id_2 = $this->post_image("tests/bedroom_workshop.jpg", "test2");
@ -16,7 +16,7 @@ class ViewTest extends ShimmiePHPUnitTestCase {
$this->assert_title("Image $image_id_1: test");
}
function testPrevNext() {
public function testPrevNext() {
$this->markTestIncomplete();
$this->log_in_as_user();

View File

@ -1,12 +1,12 @@
<?php
class WikiTest extends ShimmiePHPUnitTestCase {
function testIndex() {
public function testIndex() {
$this->get_page("wiki");
$this->assert_title("Index");
$this->assert_text("This is a default page");
}
function testAccess() {
public function testAccess() {
$this->markTestIncomplete();
global $config;
@ -40,7 +40,7 @@ class WikiTest extends ShimmiePHPUnitTestCase {
}
}
function testLock() {
public function testLock() {
$this->markTestIncomplete();
global $config;
@ -76,7 +76,7 @@ class WikiTest extends ShimmiePHPUnitTestCase {
$this->log_out();
}
function testDefault() {
public function testDefault() {
$this->markTestIncomplete();
$this->log_in_as_admin();
@ -95,7 +95,7 @@ class WikiTest extends ShimmiePHPUnitTestCase {
$this->log_out();
}
function testRevisions() {
public function testRevisions() {
$this->markTestIncomplete();
$this->log_in_as_admin();

View File

@ -1,12 +1,12 @@
<?php
class WordFilterTest extends ShimmiePHPUnitTestCase {
function setUp() {
public function setUp() {
global $config;
parent::setUp();
$config->set_string("word_filter", "whore,nice lady\na duck,a kitten\n white ,\tspace\ninvalid");
}
function _doThings($in, $out) {
public function _doThings($in, $out) {
global $user;
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
@ -15,49 +15,49 @@ class WordFilterTest extends ShimmiePHPUnitTestCase {
$this->assert_text($out);
}
function testRegular() {
public function testRegular() {
$this->_doThings(
"posted by a whore",
"posted by a nice lady"
);
}
function testReplaceAll() {
public function testReplaceAll() {
$this->_doThings(
"a whore is a whore is a whore",
"a nice lady is a nice lady is a nice lady"
);
}
function testMixedCase() {
public function testMixedCase() {
$this->_doThings(
"monkey WhorE",
"monkey nice lady"
);
}
function testOnlyWholeWords() {
public function testOnlyWholeWords() {
$this->_doThings(
"my name is whoretta",
"my name is whoretta"
);
}
function testMultipleWords() {
public function testMultipleWords() {
$this->_doThings(
"I would like a duck",
"I would like a kitten"
);
}
function testWhitespace() {
public function testWhitespace() {
$this->_doThings(
"A colour is white",
"A colour is space"
);
}
function testIgnoreInvalid() {
public function testIgnoreInvalid() {
$this->_doThings(
"The word was invalid",
"The word was invalid"