webgui/t/Asset/Wobject/GalleryAlbum/rss.t
2007-12-17 22:22:06 +00:00

66 lines
2.2 KiB
Perl

# $vim: syntax=perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2007 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
#-------------------------------------------------------------------
use FindBin;
use strict;
use lib "$FindBin::Bin/../../../../lib";
## The goal of this test is to test the rss view of GalleryAlbums
use Scalar::Util qw( blessed );
use WebGUI::Test;
use WebGUI::Session;
use Test::More;
use WebGUI::Test::Maker::HTML;
#----------------------------------------------------------------------------
# Init
my $maker = WebGUI::Test::Maker::HTML->new;
my $session = WebGUI::Test->session;
my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Album Test"});
my $gallery
= $node->addChild({
className => "WebGUI::Asset::Wobject::Gallery",
groupIdAddComment => 2, # Registered Users
groupIdAddFile => 2, # Registered Users
groupIdView => 7, # Everyone
groupIdEdit => 3, # Admins
ownerUserId => 3, # Admin
});
my $album
= $gallery->addChild({
className => "WebGUI::Asset::Wobject::GalleryAlbum",
ownerUserId => "3", # Admin
});
my @photos;
for my $i ( 0 .. 5 ) {
$photos[ $i ]
= $album->addChild({
className => "WebGUI::Asset::File::Image::Photo",
filename => "$i.jpg",
});
}
#----------------------------------------------------------------------------
# Cleanup
END {
$versionTag->rollback();
}
#----------------------------------------------------------------------------
# Tests
plan no_plan => 1;
#----------------------------------------------------------------------------
# Test www_viewRss