diff --git a/t/Account.t b/t/Account.t deleted file mode 100644 index 96399fe36..000000000 --- a/t/Account.t +++ /dev/null @@ -1,9 +0,0 @@ -use FindBin; -use lib "$FindBin::Bin/lib"; -use Test::WebGUI::Account; -use Test::WebGUI::Account::Friends; -use Test::WebGUI::Account::Inbox; -use Test::WebGUI::Account::Contributions; -use Test::WebGUI::Account::User; - -Test::Class->runtests; diff --git a/t/lib/Test/WebGUI/Account.pm b/t/lib/Test/WebGUI/Account.pm deleted file mode 100644 index 2f4cb8f38..000000000 --- a/t/lib/Test/WebGUI/Account.pm +++ /dev/null @@ -1,98 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# This tests the operation of WebGUI::Account modules. You can use -# as a base to test your own modules. - -package Test::WebGUI::Account; - -use FindBin; -use strict; -use lib "$FindBin::Bin/lib"; -use base 'Test::Class'; -use Test::More; -use Test::Exception; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; - -sub class { - return 'WebGUI::Account'; -} - -sub __useItFirst : Test(startup) { - my $test = shift; - my $class = $test->class; - eval "use $class"; - die $@ if $@; - my $session = WebGUI::Test->session; - $test->{_session} = $session; -} - -sub _new : Test(5) { - my $test = shift; - my $session = $test->{_session}; - my $class = $test->class; - throws_ok( - sub { $class->new }, 'WebGUI::Error::InvalidObject', - 'new() throws exception without session object' - ); - my $account; - ok( $account = $class->new( $session ), - "$class object created successfully" - ); - isa_ok( $account, $class, 'Blessed into the right class' ); - is($account->uid, undef, 'new account objects have no uid'); - is($account->method, 'view', 'default method is view'); -} - -sub getUrl : Test(6) { - my $test = shift; - my $session = $test->{_session}; - my $class = $test->class; - my $account = $class->new($session); - is( $account->getUrl, $session->url->page('op=account;module=;do='.$account->method), - 'getUrl adds op, module, and do since no method has been set' - ); - - is( $account->getUrl( 'foo=bar' ), $session->url->page( 'op=account;foo=bar' ), - 'getUrl adds op if passed other parameters' - ); - - is( $account->getUrl( 'op=account' ), $session->url->page( 'op=account' ), - 'getUrl doesnt add op=account if already exists' - ); - - is( $account->getUrl('', 1), $session->url->page('op=account;module=;do='.$account->method), - 'getUrl does not add uid unless requested, unless uid is set' - ); - - $account->uid(3); - is( $account->getUrl, $session->url->page('op=account;module=;do='.$account->method), - 'getUrl does not add uid unless requested, even when set' - ); - - is( $account->getUrl('', 1), $session->url->page('op=account;module=;do='.$account->method.';uid=3'), - 'getUrl adds uid when requested, and uid is set' - ); - -} - -sub canView : Test(1) { - my $test = shift; - my $session = $test->{_session}; - my $class = $test->class; - my $account = $class->new($session); - is($account->canView(), 1, 'default canView is 1'); -} - -1; - -#vim:ft=perl diff --git a/t/lib/Test/WebGUI/Account/Contributions.pm b/t/lib/Test/WebGUI/Account/Contributions.pm deleted file mode 100644 index c5a4af1df..000000000 --- a/t/lib/Test/WebGUI/Account/Contributions.pm +++ /dev/null @@ -1,32 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# This tests the operation of WebGUI::Account modules. You can use -# as a base to test your own modules. - -package Test::WebGUI::Account::Contributions; - -use FindBin; -use strict; -use lib "$FindBin::Bin/lib"; -use base 'Test::WebGUI::Account'; -use Test::More; -use Test::Exception; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; - -sub class { - return 'WebGUI::Account::Contributions'; -} - -1; - -#vim:ft=perl diff --git a/t/lib/Test/WebGUI/Account/Friends.pm b/t/lib/Test/WebGUI/Account/Friends.pm deleted file mode 100644 index f7061807d..000000000 --- a/t/lib/Test/WebGUI/Account/Friends.pm +++ /dev/null @@ -1,37 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# This tests the operation of WebGUI::Account modules. You can use -# as a base to test your own modules. - -package Test::WebGUI::Account::Friends; - -use FindBin; -use strict; -use lib "$FindBin::Bin/lib"; -use base 'Test::WebGUI::Account'; -use Test::More; -use Test::Exception; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; - -sub class { - return 'WebGUI::Account::Friends'; -} - -sub canView : Test(1) { - local $TODO = 'Write tests for canView for Friends'; - ok(0,'Tests for canView for Friends'); -} - -1; - -#vim:ft=perl diff --git a/t/lib/Test/WebGUI/Account/Inbox.pm b/t/lib/Test/WebGUI/Account/Inbox.pm deleted file mode 100644 index 0e4cdea8b..000000000 --- a/t/lib/Test/WebGUI/Account/Inbox.pm +++ /dev/null @@ -1,43 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# This tests the operation of WebGUI::Account modules. You can use -# as a base to test your own modules. - -package Test::WebGUI::Account::Inbox; - -use FindBin; -use strict; -use lib "$FindBin::Bin/lib"; -use base 'Test::WebGUI::Account'; -use Test::More; -use Test::Exception; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; - -sub class { - return 'WebGUI::Account::Inbox'; -} - -sub canView : Test(2) { - my $test = shift; - my $session = $test->{_session}; - my $class = $test->class; - my $account = $class->new($session); - $account->uid(3); - ok(! $account->canView, 'canView is 0 if uid is set, for any userId'); - $account->uid(''); - ok( $account->canView, 'canView is 0 if uid is empty string'); -} - -1; - -#vim:ft=perl diff --git a/t/lib/Test/WebGUI/Account/User.pm b/t/lib/Test/WebGUI/Account/User.pm deleted file mode 100644 index 8cb2c6c23..000000000 --- a/t/lib/Test/WebGUI/Account/User.pm +++ /dev/null @@ -1,43 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# This tests the operation of WebGUI::Account modules. You can use -# as a base to test your own modules. - -package Test::WebGUI::Account::User; - -use FindBin; -use strict; -use lib "$FindBin::Bin/lib"; -use base 'Test::WebGUI::Account'; -use Test::More; -use Test::Exception; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; - -sub class { - return 'WebGUI::Account::User'; -} - -sub canView : Test(2) { - my $test = shift; - my $session = $test->{_session}; - my $class = $test->class; - my $account = $class->new($session); - $account->uid(3); - ok(! $account->canView, 'canView is 0 if uid is set, for any userId'); - $account->uid(''); - ok( $account->canView, 'canView is 0 if uid is empty string'); -} - -1; - -#vim:ft=perl