beginning of Storage test
This commit is contained in:
parent
21fedb9051
commit
548dfb6f41
1 changed files with 47 additions and 0 deletions
47
t/Storage.t
Normal file
47
t/Storage.t
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2006 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";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
|
||||
use Test::More;
|
||||
|
||||
plan tests => 6; # increment this value for each test you create
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
my $uploadDir = $session->config->get('uploadsPath');
|
||||
|
||||
ok ($uploadDir, "uploadDir defined in config");
|
||||
|
||||
ok ((-e $uploadDir and -d $uploadDir), "uploadDir exists and is a directory");
|
||||
|
||||
my $storage1 = WebGUI::Storage->get($session);
|
||||
|
||||
is( $storage1, undef, "get requires id to be passed");
|
||||
|
||||
$storage1 = WebGUI::Storage->get($session, 'foobar');
|
||||
|
||||
is( ref $storage1, "WebGUI::Storage", "storage will accept non GUID arguments");
|
||||
|
||||
is( $storage1->getErrorCount, 0, "No errors during path creation");
|
||||
|
||||
my $storageDir1 = join '/', $uploadDir, 'fo', 'ob', 'foobar';
|
||||
|
||||
ok( (-e $storageDir1 and -d $storageDir1), "Storage location created and is a directory");
|
||||
|
||||
END {
|
||||
ref $storage1 eq "WebGUI::Storage" and $storage1->delete;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue