configurable testing URL

git-svn-id: file:///home/shish/svn/shimmie2/trunk@1096 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-10-18 10:34:15 +00:00
parent 99954fe6ae
commit 98f6800f9d
14 changed files with 42 additions and 42 deletions

View file

@ -1,7 +1,7 @@
<?php
class HomeTest extends WebTestCase {
function testHomePage() {
$this->get('http://shimmie.shishnet.org/v2/home');
$this->get(TEST_BASE.'/home');
$this->assertTitle('Shimmie Testbed');
$this->assertText('Shimmie Testbed');
}

View file

@ -1,17 +1,17 @@
<?php
class IPBanTest extends WebTestCase {
function testIPBan() {
$this->get('http://shimmie.shishnet.org/v2/ip_ban/list');
$this->get(TEST_BASE.'/ip_ban/list');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
$this->get('http://shimmie.shishnet.org/v2/user');
$this->get(TEST_BASE.'/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->get(TEST_BASE.'/ip_ban/list');
$this->assertNoText("42.42.42.42");
$this->setField('ip', '42.42.42.42');
$this->setField('reason', 'unit testing');

View file

@ -1,7 +1,7 @@
<?php
class RSSCommentsTest extends WebTestCase {
function testImageFeed() {
$this->get('http://shimmie.shishnet.org/v2/rss/comments');
$this->get(TEST_BASE.'/rss/comments');
$this->assertMime("application/rss+xml");
$this->assertNoText("Exception");
}

View file

@ -1,7 +1,7 @@
<?php
class RSSImagesTest extends WebTestCase {
function testImageFeed() {
$this->get('http://shimmie.shishnet.org/v2/rss/images');
$this->get(TEST_BASE.'/rss/images');
$this->assertMime("application/rss+xml");
$this->assertNoText("Exception");
}

View file

@ -1,7 +1,7 @@
<?php
class AdminPageTest extends WebTestCase {
function testAuth() {
$this->get('http://shimmie.shishnet.org/v2/admin');
$this->get(TEST_BASE.'/admin');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
@ -9,7 +9,7 @@ class AdminPageTest extends WebTestCase {
$this->setField('user', USER_NAME);
$this->setField('pass', USER_PASS);
$this->click("Log In");
$this->get('http://shimmie.shishnet.org/v2/admin');
$this->get(TEST_BASE.'/admin');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
$this->click('Log Out');
@ -18,7 +18,7 @@ class AdminPageTest extends WebTestCase {
$this->setField('user', ADMIN_NAME);
$this->setField('pass', ADMIN_PASS);
$this->click("Log In");
$this->get('http://shimmie.shishnet.org/v2/admin');
$this->get(TEST_BASE.'/admin');
$this->assertTitle("Admin Tools");
$this->click('Log Out');
}

View file

@ -2,7 +2,7 @@
class AliasEditorTest extends WebTestCase {
function testAliasEditor() {
/*
$this->get('http://shimmie.shishnet.org/v2/admin');
$this->get(TEST_BASE.'/admin');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
@ -10,7 +10,7 @@ class AliasEditorTest extends WebTestCase {
$this->setField('user', USER_NAME);
$this->setField('pass', USER_PASS);
$this->click("Log In");
$this->get('http://shimmie.shishnet.org/v2/admin');
$this->get(TEST_BASE.'/admin');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
$this->click('Log Out');
@ -19,7 +19,7 @@ class AliasEditorTest extends WebTestCase {
$this->setField('user', ADMIN_NAME);
$this->setField('pass', ADMIN_PASS);
$this->click("Log In");
$this->get('http://shimmie.shishnet.org/v2/admin');
$this->get(TEST_BASE.'/admin');
$this->assertTitle("Admin Tools");
$this->click('Log Out');
*/

View file

@ -1,10 +1,10 @@
<?php
class CommentListTest extends WebTestCase {
function testCommentsPage() {
$this->get('http://shimmie.shishnet.org/v2/comment/list');
$this->get(TEST_BASE.'/comment/list');
$this->assertTitle('Comments');
$this->get('http://shimmie.shishnet.org/v2/comment/list/2');
$this->get(TEST_BASE.'/comment/list/2');
$this->assertTitle('Comments');
}
}

View file

@ -1,7 +1,7 @@
<?php
class ExtManagerTest extends WebTestCase {
function testAuth() {
$this->get('http://shimmie.shishnet.org/v2/ext_manager');
$this->get(TEST_BASE.'/ext_manager');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
@ -9,7 +9,7 @@ class ExtManagerTest extends WebTestCase {
$this->setField('user', USER_NAME);
$this->setField('pass', USER_PASS);
$this->click("Log In");
$this->get('http://shimmie.shishnet.org/v2/ext_manager');
$this->get(TEST_BASE.'/ext_manager');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
$this->click('Log Out');
@ -18,7 +18,7 @@ class ExtManagerTest extends WebTestCase {
$this->setField('user', ADMIN_NAME);
$this->setField('pass', ADMIN_PASS);
$this->click("Log In");
$this->get('http://shimmie.shishnet.org/v2/ext_manager');
$this->get(TEST_BASE.'/ext_manager');
$this->assertTitle("Extensions");
$this->assertText("SimpleTest integration");
$this->click('Log Out');

View file

@ -1,7 +1,7 @@
<?php
class Handle404Test extends WebTestCase {
function test404Handler() {
$this->get('http://shimmie.shishnet.org/v2/not/a/page');
$this->get(TEST_BASE.'/not/a/page');
$this->assertResponse(404);
$this->assertTitle('404');
$this->assertText("No handler could be found for the page 'not/a/page'");

View file

@ -1,41 +1,41 @@
<?php
class IndexTest extends WebTestCase {
function testIndexPage() {
$this->get('http://shimmie.shishnet.org/v2/post/list');
$this->get(TEST_BASE.'/post/list');
$this->assertTitle("Shimmie Testbed");
$this->assertText("Prev | Index | Next");
$this->get('http://shimmie.shishnet.org/v2/post/list/-1');
$this->get(TEST_BASE.'/post/list/-1');
$this->assertTitle("Shimmie Testbed");
$this->get('http://shimmie.shishnet.org/v2/post/list/0');
$this->get(TEST_BASE.'/post/list/0');
$this->assertTitle("Shimmie Testbed");
$this->get('http://shimmie.shishnet.org/v2/post/list/1');
$this->get(TEST_BASE.'/post/list/1');
$this->assertTitle("Shimmie Testbed");
$this->get('http://shimmie.shishnet.org/v2/post/list/99999');
$this->get(TEST_BASE.'/post/list/99999');
$this->assertTitle("Shimmie Testbed");
}
function testSearches() {
$this->get('http://shimmie.shishnet.org/v2/post/list/maumaumau/1');
$this->get(TEST_BASE.'/post/list/maumaumau/1');
$this->assertTitle("maumaumau");
$this->assertText("No Images Found");
$this->get('http://shimmie.shishnet.org/v2/post/list/screenshot/1');
$this->get(TEST_BASE.'/post/list/screenshot/1');
$this->assertTitle("screenshot");
$this->get('http://shimmie.shishnet.org/v2/post/list/size=1024x768/1');
$this->get(TEST_BASE.'/post/list/size=1024x768/1');
$this->assertTitle("size=1024x768");
$this->get('http://shimmie.shishnet.org/v2/post/list/screenshot%20size=1024x768/1');
$this->get(TEST_BASE.'/post/list/screenshot%20size=1024x768/1');
$this->assertTitle("screenshot size=1024x768");
$this->get('http://shimmie.shishnet.org/v2/post/list/screenshot%20computer/1');
$this->get(TEST_BASE.'/post/list/screenshot%20computer/1');
$this->assertTitle("screenshot computer");
$this->get('http://shimmie.shishnet.org/v2/post/list/screenshot%20computer%20-pbx/1');
$this->get(TEST_BASE.'/post/list/screenshot%20computer%20-pbx/1');
$this->assertTitle("screenshot computer -pbx");
}
}

View file

@ -1,7 +1,7 @@
<?php
class SetupTest extends WebTestCase {
function testAuth() {
$this->get('http://shimmie.shishnet.org/v2/setup');
$this->get(TEST_BASE.'/setup');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
@ -9,7 +9,7 @@ class SetupTest extends WebTestCase {
$this->setField('user', USER_NAME);
$this->setField('pass', USER_PASS);
$this->click("Log In");
$this->get('http://shimmie.shishnet.org/v2/setup');
$this->get(TEST_BASE.'/setup');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
$this->click('Log Out');
@ -18,7 +18,7 @@ class SetupTest extends WebTestCase {
$this->setField('user', ADMIN_NAME);
$this->setField('pass', ADMIN_PASS);
$this->click("Log In");
$this->get('http://shimmie.shishnet.org/v2/setup');
$this->get(TEST_BASE.'/setup');
$this->assertTitle("Shimmie Setup");
$this->assertText("General");
$this->click('Log Out');

View file

@ -1,16 +1,16 @@
<?php
class TagListTest extends WebTestCase {
function testTagList() {
$this->get('http://shimmie.shishnet.org/v2/tags/map');
$this->get(TEST_BASE.'/tags/map');
$this->assertTitle('Tag List');
$this->get('http://shimmie.shishnet.org/v2/tags/alphabetic');
$this->get(TEST_BASE.'/tags/alphabetic');
$this->assertTitle('Tag List');
$this->get('http://shimmie.shishnet.org/v2/tags/popularity');
$this->get(TEST_BASE.'/tags/popularity');
$this->assertTitle('Tag List');
$this->get('http://shimmie.shishnet.org/v2/tags/categories');
$this->get(TEST_BASE.'/tags/categories');
$this->assertTitle('Tag List');
}
}

View file

@ -1,15 +1,15 @@
<?php
class UserPageTest extends WebTestCase {
function testUserPage() {
$this->get('http://shimmie.shishnet.org/v2/user');
$this->get(TEST_BASE.'/user');
$this->assertTitle("Anonymous's Page");
$this->assertNoText("Options");
$this->assertNoText("More Options");
$this->get('http://shimmie.shishnet.org/v2/user/Shish');
$this->get(TEST_BASE.'/user/Shish');
$this->assertTitle("Shish's Page");
$this->get('http://shimmie.shishnet.org/v2/user/MauMau');
$this->get(TEST_BASE.'/user/MauMau');
$this->assertTitle("No Such User");
$this->assertText("Login");

View file

@ -1,13 +1,13 @@
<?php
class ViewTest extends WebTestCase {
function testViewPage() {
$this->get('http://shimmie.shishnet.org/v2/post/view/1914');
$this->get(TEST_BASE.'/post/view/1914');
$this->assertTitle('Image 1914: test');
$this->get('http://shimmie.shishnet.org/v2/post/view/1');
$this->get(TEST_BASE.'/post/view/1');
$this->assertTitle('Image not found');
$this->get('http://shimmie.shishnet.org/v2/post/view/-1');
$this->get(TEST_BASE.'/post/view/-1');
$this->assertTitle('Image not found');
}
}