Merge with HEAD, 10472

This commit is contained in:
Colin Kuskie 2009-04-24 17:12:17 +00:00
commit 19f703dc9b
102 changed files with 5700 additions and 2269 deletions

View file

@ -35,6 +35,7 @@ use Cwd qw[];
use Test::MockObject::Extends;
use WebGUI::PseudoRequest;
use Scalar::Util qw( blessed );
use List::MoreUtils qw/ any /;
##Hack to get ALL test output onto STDOUT.
use Test::Builder;
@ -53,6 +54,7 @@ my $originalSetting;
my @groupsToDelete;
my @storagesToDelete;
my @usersToDelete;
BEGIN {
@ -138,9 +140,14 @@ BEGIN {
END {
my $Test = Test::Builder->new;
foreach my $group (@groupsToDelete) {
GROUP: foreach my $group (@groupsToDelete) {
$group->delete;
}
USER: foreach my $user (@usersToDelete) {
my $userId = $user->userId;
next USER if any { $userId eq $_ } (1,3);
$user->delete;
}
foreach my $stor (@storagesToDelete) {
if ($SESSION->id->valid($stor)) {
my $storage = WebGUI::Storage->get($SESSION, $stor);
@ -430,6 +437,22 @@ sub storagesToDelete {
#----------------------------------------------------------------------------
=head2 usersToDelete ( $user, [$user, ...] )
Push a list of user objects onto the stack of groups to be automatically deleted
at the end of the test. If found in the stack, the Admin and Visitor users will not be deleted.
This is a class method.
=cut
sub usersToDelete {
my $class = shift;
push @usersToDelete, @_;
}
#----------------------------------------------------------------------------
=head1 BUGS
When trying to load the APR module, perl invariably throws an Out Of Memory