Add a method for Payment Drivers to see if they can used by a particular user, canUse.

Add some tests for the method.
Have Pay->getOptions use the method.
This commit is contained in:
Colin Kuskie 2008-07-21 16:14:52 +00:00
parent a3274f47ec
commit 8779905ac3
4 changed files with 66 additions and 3 deletions

View file

@ -31,7 +31,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 46;
my $tests = 49;
plan tests => 1 + $tests;
#----------------------------------------------------------------------------
@ -459,6 +459,21 @@ cmp_deeply(
);
#######################################################################
#
# canUse
#
#######################################################################
$session->user({userId => 3});
ok($driver->canUse, 'canUse: session->user is used if no argument is passed');
ok(!$driver->canUse({userId => 1}), 'canUse: userId explicit works, visitor cannot use this driver');
TODO: {
local $TODO = 'tests for canUse';
ok(0, 'Test other users and groups');
}
#######################################################################
#
# delete