test files for various extensions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1070 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
a0cb32f4b2
commit
c68df68195
9
contrib/home/test.php
Normal file
9
contrib/home/test.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
class HomeTest extends WebTestCase {
|
||||
function testHomePage() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/home');
|
||||
$this->assertTitle('Shimmie Testbed');
|
||||
$this->assertText('Shimmie Testbed');
|
||||
}
|
||||
}
|
||||
?>
|
29
contrib/ipban/test.php
Normal file
29
contrib/ipban/test.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
class IPBanTest extends WebTestCase {
|
||||
function testIPBan() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/ip_ban/list');
|
||||
$this->assertResponse(403);
|
||||
$this->assertTitle("Permission Denied");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/user');
|
||||
$this->assertText("Login");
|
||||
$this->setField('user', ADMIN_NAME);
|
||||
$this->setField('pass', ADMIN_PASS);
|
||||
$this->click("Log In");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/ip_ban/list');
|
||||
$this->assertNoText("42.42.42.42");
|
||||
$this->setField('ip', '42.42.42.42');
|
||||
$this->setField('reason', 'unit testing');
|
||||
$this->setField('end', '1 week');
|
||||
$this->click("Ban");
|
||||
|
||||
$this->assertText("42.42.42.42");
|
||||
$this->click("Remove"); // FIXME: remove which ban? :S
|
||||
$this->assertNoText("42.42.42.42");
|
||||
|
||||
$this->click('Log Out');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
26
ext/admin/test.php
Normal file
26
ext/admin/test.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
class AdminPageTest extends WebTestCase {
|
||||
function testAdminPage() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/admin');
|
||||
$this->assertResponse(403);
|
||||
$this->assertTitle("Permission Denied");
|
||||
|
||||
$this->assertText("Login");
|
||||
$this->setField('user', USER_NAME);
|
||||
$this->setField('pass', USER_PASS);
|
||||
$this->click("Log In");
|
||||
$this->get('http://shimmie.shishnet.org/v2/admin');
|
||||
$this->assertResponse(403);
|
||||
$this->assertTitle("Permission Denied");
|
||||
$this->click('Log Out');
|
||||
|
||||
$this->assertText("Login");
|
||||
$this->setField('user', ADMIN_NAME);
|
||||
$this->setField('pass', ADMIN_PASS);
|
||||
$this->click("Log In");
|
||||
$this->get('http://shimmie.shishnet.org/v2/admin');
|
||||
$this->assertTitle("Admin Tools");
|
||||
$this->click('Log Out');
|
||||
}
|
||||
}
|
||||
?>
|
28
ext/alias_editor/test.php
Normal file
28
ext/alias_editor/test.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
class AliasEditorTest extends WebTestCase {
|
||||
function testAliasEditor() {
|
||||
/*
|
||||
$this->get('http://shimmie.shishnet.org/v2/admin');
|
||||
$this->assertResponse(403);
|
||||
$this->assertTitle("Permission Denied");
|
||||
|
||||
$this->assertText("Login");
|
||||
$this->setField('user', USER_NAME);
|
||||
$this->setField('pass', USER_PASS);
|
||||
$this->click("Log In");
|
||||
$this->get('http://shimmie.shishnet.org/v2/admin');
|
||||
$this->assertResponse(403);
|
||||
$this->assertTitle("Permission Denied");
|
||||
$this->click('Log Out');
|
||||
|
||||
$this->assertText("Login");
|
||||
$this->setField('user', ADMIN_NAME);
|
||||
$this->setField('pass', ADMIN_PASS);
|
||||
$this->click("Log In");
|
||||
$this->get('http://shimmie.shishnet.org/v2/admin');
|
||||
$this->assertTitle("Admin Tools");
|
||||
$this->click('Log Out');
|
||||
*/
|
||||
}
|
||||
}
|
||||
?>
|
11
ext/comment/test.php
Normal file
11
ext/comment/test.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
class CommentListTest extends WebTestCase {
|
||||
function testCommentsPage() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/comment/list');
|
||||
$this->assertTitle('Comments');
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/comment/list/2');
|
||||
$this->assertTitle('Comments');
|
||||
}
|
||||
}
|
||||
?>
|
10
ext/handle_404/test.php
Normal file
10
ext/handle_404/test.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
class Handle404Test extends WebTestCase {
|
||||
function test404Handler() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/not/a/page');
|
||||
$this->assertResponse(404);
|
||||
$this->assertTitle('404');
|
||||
$this->assertText("No handler could be found for the page 'not/a/page'");
|
||||
}
|
||||
}
|
||||
?>
|
36
ext/index/test.php
Normal file
36
ext/index/test.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
class IndexTest extends WebTestCase {
|
||||
function testIndexPage() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list');
|
||||
$this->assertTitle("Shimmie Testbed");
|
||||
$this->assertText("Prev | Index | Next");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list/-1');
|
||||
$this->assertTitle("Shimmie Testbed");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list/0');
|
||||
$this->assertTitle("Shimmie Testbed");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list/1');
|
||||
$this->assertTitle("Shimmie Testbed");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list/99999');
|
||||
$this->assertTitle("Shimmie Testbed");
|
||||
}
|
||||
|
||||
function testSearches() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list/maumaumau/1');
|
||||
$this->assertTitle("maumaumau");
|
||||
$this->assertText("No Images Found");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list/screenshot/1');
|
||||
$this->assertTitle("screenshot");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list/screenshot%20computer/1');
|
||||
$this->assertTitle("screenshot computer");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/list/screenshot%20computer%20-pbx/1');
|
||||
$this->assertTitle("screenshot computer -pbx");
|
||||
}
|
||||
}
|
||||
?>
|
17
ext/tag_list/test.php
Normal file
17
ext/tag_list/test.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
class TagListTest extends WebTestCase {
|
||||
function testTagList() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/tags/map');
|
||||
$this->assertTitle('Tag List');
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/tags/alphabetic');
|
||||
$this->assertTitle('Tag List');
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/tags/popularity');
|
||||
$this->assertTitle('Tag List');
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/tags/categories');
|
||||
$this->assertTitle('Tag List');
|
||||
}
|
||||
}
|
||||
?>
|
36
ext/user/test.php
Normal file
36
ext/user/test.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
class UserPageTest extends WebTestCase {
|
||||
function testUserPage() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/user');
|
||||
$this->assertTitle("Anonymous's Page");
|
||||
$this->assertNoText("Options");
|
||||
$this->assertNoText("More Options");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/user/Shish');
|
||||
$this->assertTitle("Shish's Page");
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/user/MauMau');
|
||||
$this->assertTitle("No Such User");
|
||||
|
||||
$this->assertText("Login");
|
||||
$this->setField('user', USER_NAME);
|
||||
$this->setField('pass', USER_PASS);
|
||||
$this->click("Log In");
|
||||
// should be on the user page
|
||||
$this->assertTitle("test's Page");
|
||||
$this->assertText("Options");
|
||||
$this->assertNoText("More Options");
|
||||
$this->click('Log Out');
|
||||
|
||||
$this->assertText("Login");
|
||||
$this->setField('user', ADMIN_NAME);
|
||||
$this->setField('pass', ADMIN_PASS);
|
||||
$this->click("Log In");
|
||||
// should be on the user page
|
||||
$this->assertTitle(ADMIN_NAME+"'s Page");
|
||||
$this->assertText("Options");
|
||||
$this->assertText("More Options");
|
||||
$this->click('Log Out');
|
||||
}
|
||||
}
|
||||
?>
|
14
ext/view/test.php
Normal file
14
ext/view/test.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class ViewTest extends WebTestCase {
|
||||
function testViewPage() {
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/view/1914');
|
||||
$this->assertTitle('Image 1914: test');
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/view/1');
|
||||
$this->assertTitle('Image not found');
|
||||
|
||||
$this->get('http://shimmie.shishnet.org/v2/post/view/-1');
|
||||
$this->assertTitle('Image not found');
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user