testing for all upgrade script subs
This commit is contained in:
parent
15ed4f97e4
commit
94baba20fc
28 changed files with 226 additions and 81 deletions
7
t/supporting_collateral/Upgrade/collateral.pl
Normal file
7
t/supporting_collateral/Upgrade/collateral.pl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
my $c = collateral;
|
||||
|
||||
::isa_ok $c, 'Path::Class::Dir';
|
||||
|
||||
::ok -e $c->file('collateral.txt'), 'correct collateral path used';
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
collateral file
|
||||
2
t/supporting_collateral/Upgrade/config.pl
Normal file
2
t/supporting_collateral/Upgrade/config.pl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
::is config->getFilename, $::configFile, 'config function works correctly';
|
||||
|
||||
3
t/supporting_collateral/Upgrade/dbh.pl
Normal file
3
t/supporting_collateral/Upgrade/dbh.pl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
my $totalAssets = dbh->selectrow_array('SELECT COUNT(*) FROM asset');
|
||||
::is $totalAssets, $::totalAssets, 'dbh function working correctly';
|
||||
|
||||
11
t/supporting_collateral/Upgrade/package.pl
Normal file
11
t/supporting_collateral/Upgrade/package.pl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
::addToCleanup(version_tag);
|
||||
|
||||
import_package('test-template.wgpkg');
|
||||
|
||||
my $assets = version_tag->getAssets;
|
||||
|
||||
::is scalar @$assets, 1, 'imported one asset with package';
|
||||
|
||||
::isa_ok $assets->[0], 'WebGUI::Asset::Template';
|
||||
|
||||
|
||||
BIN
t/supporting_collateral/Upgrade/package/test-template.wgpkg
Normal file
BIN
t/supporting_collateral/Upgrade/package/test-template.wgpkg
Normal file
Binary file not shown.
2
t/supporting_collateral/Upgrade/rmlib.pl
Normal file
2
t/supporting_collateral/Upgrade/rmlib.pl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
rm_lib 'WebGUI::Upgrade::Test::Module';
|
||||
|
||||
7
t/supporting_collateral/Upgrade/session.pl
Normal file
7
t/supporting_collateral/Upgrade/session.pl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
my $s = session;
|
||||
::isa_ok $s, 'WebGUI::Session';
|
||||
::is $s, session, 'session properly cached';
|
||||
::is $s->user->getId, 3, 'admin user set for session';
|
||||
|
||||
$s->getId;
|
||||
|
||||
BIN
t/supporting_collateral/Upgrade/test-template.wgpkg
Normal file
BIN
t/supporting_collateral/Upgrade/test-template.wgpkg
Normal file
Binary file not shown.
12
t/supporting_collateral/Upgrade/versiontag-implicit.pl
Normal file
12
t/supporting_collateral/Upgrade/versiontag-implicit.pl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
use WebGUI::Asset;
|
||||
use WebGUI::Asset::Snippet;
|
||||
WebGUI::Asset->getRoot(session)->addChild({
|
||||
className => 'WebGUI::Asset::Snippet',
|
||||
title => 'Test snippet',
|
||||
});
|
||||
my $vt = WebGUI::VersionTag->getWorking(session, 'nocreate');
|
||||
if ($vt) {
|
||||
::addToCleanup($vt);
|
||||
}
|
||||
$vt;
|
||||
|
||||
15
t/supporting_collateral/Upgrade/versiontag.pl
Normal file
15
t/supporting_collateral/Upgrade/versiontag.pl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
my $vt = version_tag;
|
||||
::addToCleanup($vt);
|
||||
|
||||
::isa_ok $vt, 'WebGUI::VersionTag';
|
||||
::is $vt->get('name'), 'Upgrade to 8.3.0 - versiontag', 'auto-naming with short name works';
|
||||
|
||||
::is $vt, version_tag, 'second call gives same version tag';
|
||||
::ok ! $vt->get('isCommitted'), '... and doesn\'t commit version tag';
|
||||
|
||||
my $vt2 = version_tag 'Adding This Stuff';
|
||||
::addToCleanup($vt);
|
||||
::ok $vt->get('isCommitted'), 'Request for new version tag commits previous tag';
|
||||
::is $vt2->get('name'), 'Upgrade to 8.3.0 - Adding This Stuff', 'explicit name used correctly';
|
||||
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
print config->getFilename;
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
my ($totalAssets) = dbh->selectrow_array('SELECT COUNT(*) FROM asset');
|
||||
print $totalAssets;
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
print session->getId;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue