All test sessions are automatically outfitted with a PseudoRequest object.
Check to see if there is an exportPath defined in the config file, if not, safely skip all of the tests.
This commit is contained in:
parent
a5b06fdfbd
commit
404258f7c6
1 changed files with 23 additions and 13 deletions
|
|
@ -33,17 +33,26 @@ use Test::Deep;
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Init
|
# Init
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
$session->{_request} = WebGUI::PseudoRequest->new();
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Tests
|
# Tests
|
||||||
|
|
||||||
plan tests => 145; # Increment this number for each test you create
|
my $configExportPath = $session->config->get('exportPath');
|
||||||
|
|
||||||
|
my $testRan = 1;
|
||||||
|
|
||||||
|
if ($configExportPath) {
|
||||||
|
plan tests => 145; # Increment this number for each test you create
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$testRan = 0;
|
||||||
|
plan skip_all => 'No exportPath in the config file';
|
||||||
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# exportCheckPath()
|
# exportCheckPath()
|
||||||
|
|
||||||
|
|
||||||
my $e;
|
my $e;
|
||||||
|
|
||||||
# ensure exportCheckPath barfs if not given a session as its first argument.
|
# ensure exportCheckPath barfs if not given a session as its first argument.
|
||||||
|
|
@ -977,17 +986,18 @@ is($home->exportGetUrlAsPath->absolute->stringify, readlink $rootUrlSymlink->abs
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Cleanup
|
# Cleanup
|
||||||
END {
|
END {
|
||||||
|
if ($testRan) {
|
||||||
|
# remove $tempDirectory since it now exists in the filesystem
|
||||||
|
rmtree($tempDirectory);
|
||||||
|
|
||||||
# remove $tempDirectory since it now exists in the filesystem
|
# restore the original exportPath setting, now that we're done testing
|
||||||
rmtree($tempDirectory);
|
# exportCheckPath.
|
||||||
|
$session->config->set('exportPath', $originalExportPath);
|
||||||
|
|
||||||
# restore the original exportPath setting, now that we're done testing
|
# we created a couple of assets; roll them back so they don't stick around
|
||||||
# exportCheckPath.
|
$versionTag->rollback();
|
||||||
$session->config->set('exportPath', $originalExportPath);
|
|
||||||
|
|
||||||
# we created a couple of assets; roll them back so they don't stick around
|
# make sure people can view /home
|
||||||
$versionTag->rollback();
|
$home->update( { groupIdView => 7 } ); # everyone
|
||||||
|
}
|
||||||
# make sure people can view /home
|
|
||||||
$home->update( { groupIdView => 7 } ); # everyone
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue