add #10082 Unarchive all collaboration posts

This commit is contained in:
Doug Bell 2009-10-22 01:27:39 -05:00
parent ecd5b149ca
commit 473fbeab68
4 changed files with 115 additions and 0 deletions

View file

@ -0,0 +1,56 @@
# 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
#------------------------------------------------------------------
# Test the unarchiveAll function of the collaboration system
#
#
use FindBin;
use strict;
use lib "$FindBin::Bin/../../../lib";
use Test::More;
use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
#----------------------------------------------------------------------------
# Init
my $session = WebGUI::Test->session;
my $collab = WebGUI::Asset->getImportNode( $session )->addChild({
className => 'WebGUI::Asset::Wobject::Collaboration',
archiveAfter => 60*60*365.25,
});
# Add a thread
my @threads = (
$collab->addChild({
className => 'WebGUI::Asset::Post::Thread',
status => 'archived',
title => 'Archived',
}, undef, undef, { skipAutoCommitWorkflows => 1 }),
);
my $tag = WebGUI::VersionTag->getWorking( $session );
$tag->commit;
WebGUI::Test->tagsToRollback($tag);
#----------------------------------------------------------------------------
# Tests
plan tests => 1; # Increment this number for each test you create
#----------------------------------------------------------------------------
# www_unarchiveAll sets all threads to approved
$collab->www_unarchiveAll;
$threads[0] = WebGUI::Asset->newByDynamicClass( $session, $threads[0]->getId );
is( $threads[0]->get('status'), 'approved', "unarchiveAll sets thread to approved" );
#vim:ft=perl