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