whitespace
This commit is contained in:
parent
90f27cf7fd
commit
eb8c15b9a0
@ -18,17 +18,17 @@ class AdminPageTest extends ShimmieWebTestCase {
|
||||
$this->log_in_as_admin();
|
||||
$image_id_1 = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "TeStCase$ts");
|
||||
|
||||
$this->get_page("post/view/$image_id_1");
|
||||
$this->assert_title("Image $image_id_1: TeStCase$ts");
|
||||
$this->get_page("post/view/$image_id_1");
|
||||
$this->assert_title("Image $image_id_1: TeStCase$ts");
|
||||
|
||||
$this->get_page('admin');
|
||||
$this->assert_title("Admin Tools");
|
||||
$this->set_field("action", "lowercase all tags");
|
||||
$this->click("Go");
|
||||
|
||||
$this->get_page("post/view/$image_id_1");
|
||||
$this->get_page("post/view/$image_id_1");
|
||||
// FIXME: doesn't work?
|
||||
//$this->assert_title("Image $image_id_1: testcase$ts");
|
||||
//$this->assert_title("Image $image_id_1: testcase$ts");
|
||||
|
||||
$this->delete_image($image_id_1);
|
||||
$this->log_out();
|
||||
|
@ -3,13 +3,13 @@ class BulkAddTest extends ShimmieWebTestCase {
|
||||
function testBulkAdd() {
|
||||
$this->log_in_as_admin();
|
||||
|
||||
$this->get_page('admin');
|
||||
$this->get_page('admin');
|
||||
$this->assert_title("Admin Tools");
|
||||
$this->set_field('dir', "asdf");
|
||||
$this->click("Add");
|
||||
$this->assert_text("is not a directory");
|
||||
|
||||
$this->get_page('admin');
|
||||
$this->get_page('admin');
|
||||
$this->assert_title("Admin Tools");
|
||||
$this->set_field('dir', "contrib/simpletest");
|
||||
$this->click("Add");
|
||||
|
@ -8,16 +8,16 @@ class FeaturedTest extends ShimmieWebTestCase {
|
||||
# FIXME: test that regular users can't feature things
|
||||
|
||||
$this->log_in_as_admin();
|
||||
$this->get_page("post/view/$image_id");
|
||||
$this->get_page("post/view/$image_id");
|
||||
$this->assert_title("Image $image_id: pbx");
|
||||
$this->click("Feature This");
|
||||
$this->get_page("post/list");
|
||||
$this->get_page("post/list");
|
||||
$this->assert_text("Featured Image");
|
||||
$this->delete_image($image_id);
|
||||
$this->log_out();
|
||||
|
||||
# after deletion, there should be no feature
|
||||
$this->get_page("post/list");
|
||||
$this->get_page("post/list");
|
||||
$this->assert_no_text("Featured Image");
|
||||
|
||||
# FIXME: test changing from one feature to another
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
class HomeTest extends ShimmieWebTestCase {
|
||||
function testHomePage() {
|
||||
$this->get_page('home');
|
||||
$this->assert_title('Shimmie');
|
||||
$this->assert_text('Shimmie');
|
||||
function testHomePage() {
|
||||
$this->get_page('home');
|
||||
$this->assert_title('Shimmie');
|
||||
$this->assert_text('Shimmie');
|
||||
|
||||
# FIXME: test search box
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
class IPBanTest extends SCoreWebTestCase {
|
||||
function testIPBan() {
|
||||
$this->get_page('ip_ban/list');
|
||||
$this->get_page('ip_ban/list');
|
||||
$this->assert_response(403);
|
||||
$this->assert_title("Permission Denied");
|
||||
|
||||
$this->log_in_as_admin();
|
||||
$this->log_in_as_admin();
|
||||
|
||||
$this->get_page('ip_ban/list');
|
||||
$this->get_page('ip_ban/list');
|
||||
$this->assert_no_text("42.42.42.42");
|
||||
$this->set_field('ip', '42.42.42.42');
|
||||
$this->set_field('reason', 'unit testing');
|
||||
@ -18,7 +18,7 @@ class IPBanTest extends SCoreWebTestCase {
|
||||
$this->click("Remove"); // FIXME: remove which ban? :S
|
||||
$this->assert_no_text("42.42.42.42");
|
||||
|
||||
$this->get_page('ip_ban/list?all=on'); // just test it doesn't crash for now
|
||||
$this->get_page('ip_ban/list?all=on'); // just test it doesn't crash for now
|
||||
|
||||
$this->log_out();
|
||||
|
||||
|
@ -5,13 +5,13 @@ class RandomTest extends ShimmieWebTestCase {
|
||||
$image_id = $this->post_image("ext/simpletest/data/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");
|
||||
|
||||
$raw = $this->get_page("random_image/download");
|
||||
$raw = $this->get_page("random_image/download");
|
||||
# FIXME: assert($raw == file(blah.jpg))
|
||||
|
||||
$this->log_in_as_admin();
|
||||
|
@ -3,7 +3,7 @@ class RegenThumbTest extends ShimmieWebTestCase {
|
||||
function testRegenThumb() {
|
||||
$this->log_in_as_admin();
|
||||
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "pbx computer screenshot");
|
||||
$this->get_page("post/view/$image_id");
|
||||
$this->get_page("post/view/$image_id");
|
||||
$this->click("Regenerate");
|
||||
$this->assert_title("Thumbnail Regenerated");
|
||||
$this->delete_image($image_id);
|
||||
|
@ -9,7 +9,7 @@ class RSSCommentsTest extends ShimmieWebTestCase {
|
||||
$this->assert_text("ASDFASDF");
|
||||
$this->log_out();
|
||||
|
||||
$this->get_page('rss/comments');
|
||||
$this->get_page('rss/comments');
|
||||
$this->assert_mime("application/rss+xml");
|
||||
$this->assert_no_text("Exception");
|
||||
$this->assert_text("ASDFASDF");
|
||||
|
@ -5,26 +5,26 @@ class RSSImagesTest extends ShimmieWebTestCase {
|
||||
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "pbx computer screenshot");
|
||||
$this->log_out();
|
||||
|
||||
$this->get_page('rss/images');
|
||||
$this->get_page('rss/images');
|
||||
$this->assert_mime("application/rss+xml");
|
||||
$this->assert_no_text("Exception");
|
||||
|
||||
$this->get_page('rss/images/1');
|
||||
$this->get_page('rss/images/1');
|
||||
$this->assert_mime("application/rss+xml");
|
||||
$this->assert_no_text("Exception");
|
||||
|
||||
# FIXME: test that the image is actually found
|
||||
$this->get_page('rss/images/computer/1');
|
||||
$this->get_page('rss/images/computer/1');
|
||||
$this->assert_mime("application/rss+xml");
|
||||
$this->assert_no_text("Exception");
|
||||
|
||||
# valid tag, invalid page
|
||||
$this->get_page('rss/images/computer/2');
|
||||
$this->get_page('rss/images/computer/2');
|
||||
$this->assert_mime("application/rss+xml");
|
||||
$this->assert_no_text("Exception");
|
||||
|
||||
# not found
|
||||
$this->get_page('rss/images/waffle/2');
|
||||
$this->get_page('rss/images/waffle/2');
|
||||
$this->assert_mime("application/rss+xml");
|
||||
$this->assert_no_text("Exception");
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
class AliasEditorTest extends ShimmieWebTestCase {
|
||||
function testAliasEditor() {
|
||||
$this->get_page('alias/list');
|
||||
$this->get_page('alias/list');
|
||||
$this->assert_title("Alias List");
|
||||
|
||||
$this->log_in_as_admin();
|
||||
|
||||
# test one to one
|
||||
$this->get_page('alias/list');
|
||||
$this->get_page('alias/list');
|
||||
$this->assert_title("Alias List");
|
||||
$this->set_field('oldtag', "test1");
|
||||
$this->set_field('newtag', "test2");
|
||||
@ -26,13 +26,13 @@ class AliasEditorTest extends ShimmieWebTestCase {
|
||||
$this->assert_title("Image $image_id: test2");
|
||||
$this->delete_image($image_id);
|
||||
|
||||
$this->get_page('alias/list');
|
||||
$this->get_page('alias/list');
|
||||
$this->click("Remove");
|
||||
$this->assert_title("Alias List");
|
||||
$this->assert_no_text("test1");
|
||||
|
||||
# test one to many
|
||||
$this->get_page('alias/list');
|
||||
$this->get_page('alias/list');
|
||||
$this->assert_title("Alias List");
|
||||
$this->set_field('oldtag', "onetag");
|
||||
$this->set_field('newtag', "multi tag");
|
||||
@ -58,7 +58,7 @@ class AliasEditorTest extends ShimmieWebTestCase {
|
||||
$this->delete_image($image_id_1);
|
||||
$this->delete_image($image_id_2);
|
||||
|
||||
$this->get_page('alias/list');
|
||||
$this->get_page('alias/list');
|
||||
$this->click("Remove");
|
||||
$this->assert_title("Alias List");
|
||||
$this->assert_no_text("test1");
|
||||
@ -66,7 +66,7 @@ class AliasEditorTest extends ShimmieWebTestCase {
|
||||
$this->log_out();
|
||||
|
||||
|
||||
$this->get_page('alias/list');
|
||||
$this->get_page('alias/list');
|
||||
$this->assert_title("Alias List");
|
||||
$this->assert_no_text("Add");
|
||||
}
|
||||
|
@ -9,20 +9,20 @@ class IndexTest extends ShimmieWebTestCase {
|
||||
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "pbx computer screenshot");
|
||||
$this->log_out();
|
||||
|
||||
$this->get_page('post/list');
|
||||
$this->get_page('post/list');
|
||||
$this->assert_title("Shimmie");
|
||||
$this->assert_text("Prev | Index | Next");
|
||||
|
||||
$this->get_page('post/list/-1');
|
||||
$this->get_page('post/list/-1');
|
||||
$this->assert_title("Shimmie");
|
||||
|
||||
$this->get_page('post/list/0');
|
||||
$this->get_page('post/list/0');
|
||||
$this->assert_title("Shimmie");
|
||||
|
||||
$this->get_page('post/list/1');
|
||||
$this->get_page('post/list/1');
|
||||
$this->assert_title("Shimmie");
|
||||
|
||||
$this->get_page('post/list/99999');
|
||||
$this->get_page('post/list/99999');
|
||||
$this->assert_title("Shimmie");
|
||||
|
||||
$this->log_in_as_admin();
|
||||
@ -43,17 +43,17 @@ class IndexTest extends ShimmieWebTestCase {
|
||||
$this->assertTrue($image_id_2 > 0);
|
||||
|
||||
# regular tag, no results
|
||||
$this->get_page('post/list/maumaumau/1');
|
||||
$this->get_page('post/list/maumaumau/1');
|
||||
$this->assert_title("maumaumau");
|
||||
$this->assert_text("No Images Found");
|
||||
|
||||
# regular tag, many results
|
||||
$this->get_page('post/list/computer/1');
|
||||
$this->get_page('post/list/computer/1');
|
||||
$this->assert_title("computer");
|
||||
$this->assert_no_text("No Images Found");
|
||||
|
||||
# meta tag, many results
|
||||
$this->get_page('post/list/size=640x480/1');
|
||||
$this->get_page('post/list/size=640x480/1');
|
||||
$this->assert_title("size=640x480");
|
||||
$this->assert_no_text("No Images Found");
|
||||
|
||||
@ -68,13 +68,13 @@ class IndexTest extends ShimmieWebTestCase {
|
||||
$this->assert_no_text("No Images Found");
|
||||
|
||||
# multiple tags, many results
|
||||
$this->get_page('post/list/computer%20size=640x480/1');
|
||||
$this->get_page('post/list/computer%20size=640x480/1');
|
||||
$this->assert_title("computer size=640x480");
|
||||
$this->assert_no_text("No Images Found");
|
||||
|
||||
# multiple tags, one of which doesn't exist
|
||||
# (test the "one tag doesn't exist = no hits" path)
|
||||
$this->get_page('post/list/computer%20asdfasdfwaffle/1');
|
||||
$this->get_page('post/list/computer%20asdfasdfwaffle/1');
|
||||
$this->assert_text("No Images Found");
|
||||
|
||||
# multiple tags, single result; search with one result = direct to image
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
class SetupTest extends SCoreWebTestCase {
|
||||
function testAuth() {
|
||||
$this->get_page('setup');
|
||||
$this->get_page('setup');
|
||||
$this->assert_response(403);
|
||||
$this->assert_title("Permission Denied");
|
||||
|
||||
@ -12,17 +12,17 @@ class SetupTest extends SCoreWebTestCase {
|
||||
$this->assertTrue($raw == "ok");
|
||||
|
||||
$this->log_in_as_user();
|
||||
$this->get_page('setup');
|
||||
$this->get_page('setup');
|
||||
$this->assert_response(403);
|
||||
$this->assert_title("Permission Denied");
|
||||
$this->log_out();
|
||||
|
||||
$this->log_in_as_admin();
|
||||
$this->get_page('setup');
|
||||
$this->get_page('setup');
|
||||
$this->assert_title("Shimmie Setup");
|
||||
$this->assert_text("General");
|
||||
|
||||
$this->get_page('setup/advanced');
|
||||
$this->get_page('setup/advanced');
|
||||
$this->assert_title("Shimmie Setup");
|
||||
$this->assert_text("thumb_quality");
|
||||
$this->log_out();
|
||||
|
@ -8,23 +8,23 @@ class ViewTest extends ShimmieWebTestCase {
|
||||
$idp1 = $image_id_3 + 1;
|
||||
$this->log_out();
|
||||
|
||||
$this->get_page("post/view/$image_id_1");
|
||||
$this->assert_title("Image $image_id_1: test");
|
||||
$this->get_page("post/view/$image_id_1");
|
||||
$this->assert_title("Image $image_id_1: test");
|
||||
|
||||
$this->click("Prev");
|
||||
$this->assert_title("Image $image_id_2: test2");
|
||||
$this->assert_title("Image $image_id_2: test2");
|
||||
|
||||
$this->click("Next");
|
||||
$this->assert_title("Image $image_id_1: test");
|
||||
$this->assert_title("Image $image_id_1: test");
|
||||
|
||||
$this->click("Next");
|
||||
$this->assert_title("Image not found");
|
||||
$this->assert_title("Image not found");
|
||||
|
||||
$this->get_page("post/view/$idp1");
|
||||
$this->assert_title('Image not found');
|
||||
$this->get_page("post/view/$idp1");
|
||||
$this->assert_title('Image not found');
|
||||
|
||||
$this->get_page('post/view/-1');
|
||||
$this->assert_title('Image not found');
|
||||
$this->get_page('post/view/-1');
|
||||
$this->assert_title('Image not found');
|
||||
|
||||
# note: skips image #2
|
||||
$this->get_page("post/view/$image_id_1?search=test"); // FIXME: assumes niceurls
|
||||
|
Loading…
x
Reference in New Issue
Block a user