More Macro test maintenance. Up through LastModified.

This commit is contained in:
Colin Kuskie 2009-10-31 14:37:15 -07:00
parent 5ea3f02520
commit 3b11493744
7 changed files with 14 additions and 71 deletions

View file

@ -16,6 +16,7 @@ use WebGUI::Test;
use WebGUI::Session;
use WebGUI::Group;
use WebGUI::User;
use WebGUI::Macro::GroupText;
my $session = WebGUI::Test->session;
@ -24,21 +25,13 @@ use Test::More; # increment this value for each test you create
my $numTests;
$numTests = 3; #Direct Macro tests
$numTests += 4; #Bug tests
$numTests += 1; #For the use_ok
plan tests => $numTests;
my $macro = 'WebGUI::Macro::GroupText';
my $loaded = use_ok($macro);
my @mob;
my ($ms_users, $ms_distributors, $ms_int_distributors);
my ($disti, $int_disti);
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
my $output;
$session->user({userId => 1});
@ -65,14 +58,14 @@ my $sth = $session->db->prepare('INSERT INTO myUserTable VALUES(?)');
foreach my $mob (@mob) {
$sth->execute([ $mob->userId ]);
}
WebGUI::Test->usersToDelete(@mob);
addToCleanup(@mob);
##Create the 3 groups
$ms_users = WebGUI::Group->new($session, "new");
$ms_distributors = WebGUI::Group->new($session, "new");
$ms_int_distributors = WebGUI::Group->new($session, "new");
WebGUI::Test->groupsToDelete($ms_users, $ms_distributors, $ms_int_distributors);
addToCleanup($ms_users, $ms_distributors, $ms_int_distributors);
$ms_users->name('MS Users');
$ms_distributors->name('MS Distributors');
@ -94,7 +87,7 @@ $ms_distributors->addGroups([$ms_int_distributors->getId]);
$disti = WebGUI::User->new($session, 'new');
$int_disti = WebGUI::User->new($session, 'new');
WebGUI::Test->usersToDelete($disti, $int_disti);
addToCleanup($disti, $int_disti);
$ms_distributors->addUsers([$disti->userId]);
$ms_int_distributors->addUsers([$int_disti->userId]);
@ -123,8 +116,6 @@ $output = join ',',
;
is($output, 'user,disti,int_disti', 'user is in all three groups');
}
##clean up everything
END {
$session->db->dbh->do('DROP TABLE IF EXISTS myUserTable');