Merge branch 'master' into WebGUI8, up to 7.9.10. Some tests failing due to changes in default content.
This commit is contained in:
commit
ca9a3bd6c7
34 changed files with 386 additions and 49 deletions
|
|
@ -16,7 +16,7 @@ use WebGUI::Test;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Asset::Template;
|
||||
use Exception::Class;
|
||||
use Test::More tests => 42; # increment this value for each test you create
|
||||
use Test::More tests => 46; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
use Data::Dumper;
|
||||
use JSON qw{ from_json };
|
||||
|
|
@ -179,3 +179,35 @@ WebGUI::Test->interceptLogging( sub {
|
|||
|
||||
WebGUI::Test->addToCleanup(WebGUI::VersionTag->getWorking($session));
|
||||
|
||||
my $userStyleTemplate = $importNode->addChild({
|
||||
className => "WebGUI::Asset::Template",
|
||||
title => "user function style",
|
||||
url => "ufs",
|
||||
template => "user function style",
|
||||
namespace => 'WebGUI Test Template',
|
||||
});
|
||||
|
||||
my $someOtherTemplate = $importNode->addChild({
|
||||
className => "WebGUI::Asset::Template",
|
||||
title => "some other template",
|
||||
url => "sot",
|
||||
template => "some other template",
|
||||
namespace => 'WebGUI Test Template',
|
||||
});
|
||||
|
||||
$session->setting->set('userFunctionStyleId', $userStyleTemplate->getId);
|
||||
|
||||
my $purgeCutTag = WebGUI::VersionTag->getWorking($session);
|
||||
WebGUI::Test->addToCleanup($purgeCutTag);
|
||||
|
||||
is($session->setting->get('userFunctionStyleId'), $userStyleTemplate->getId, 'Setup for cut tests.');
|
||||
|
||||
$userStyleTemplate->cut;
|
||||
is($session->setting->get('userFunctionStyleId'), 'PBtmpl0000000000000060', 'cut resets the user function style template to Fail Safe');
|
||||
|
||||
$userStyleTemplate->publish;
|
||||
$session->setting->set('userFunctionStyleId', $userStyleTemplate->getId);
|
||||
is($session->setting->get('userFunctionStyleId'), $userStyleTemplate->getId, 'Reset for purge test');
|
||||
|
||||
$userStyleTemplate->purge;
|
||||
is($session->setting->get('userFunctionStyleId'), 'PBtmpl0000000000000060', 'purge resets the user function style template to Fail Safe');
|
||||
|
|
|
|||
|
|
@ -670,6 +670,68 @@ is($archive->getKeywordStaticURL('bar'), '/home/mystories/keyword_bar.html', '..
|
|||
|
||||
$archive->update({ url => '/home/mystories' });
|
||||
|
||||
################################################################
|
||||
#
|
||||
# sortOrder
|
||||
#
|
||||
################################################################
|
||||
|
||||
my $aaa_child = $archive->addChild({className => 'WebGUI::Asset::Story', title => 'Aaaa'}, @skipAutoCommit);
|
||||
my $zzz_child = $archive->addChild({className => 'WebGUI::Asset::Story', title => 'Zzzz'}, @skipAutoCommit);
|
||||
WebGUI::Test->addToCleanup($aaa_child);
|
||||
WebGUI::Test->addToCleanup($zzz_child);
|
||||
|
||||
$archive->update({storiesPerPage => 25, storySortOrder => 'Alphabetically' });
|
||||
|
||||
$tag1 = WebGUI::VersionTag->getWorking($session);
|
||||
$tag1->commit;
|
||||
WebGUI::Test->addToCleanup($tag1);
|
||||
|
||||
$templateVars = $archive->viewTemplateVariables();
|
||||
|
||||
cmp_deeply (
|
||||
$templateVars->{date_loop},
|
||||
[
|
||||
{
|
||||
'story_loop' => [
|
||||
{
|
||||
'creationDate' => ignore(),
|
||||
'deleteIcon' => ignore(),
|
||||
'editIcon' => ignore(),
|
||||
'url' => re('aaaa'),
|
||||
'title' => 'Aaaa'
|
||||
},
|
||||
ignore(),
|
||||
ignore(),
|
||||
ignore(),
|
||||
ignore(),
|
||||
],
|
||||
'epochDate' => ignore(),
|
||||
},
|
||||
{
|
||||
'story_loop' => ignore(),
|
||||
'epochDate' => $wgBdayMorn,
|
||||
},
|
||||
{
|
||||
'story_loop' => ignore(),
|
||||
'epochDate' => $yesterdayMorn,
|
||||
},
|
||||
{
|
||||
'story_loop' => [
|
||||
{
|
||||
'creationDate' => ignore(),
|
||||
'deleteIcon' => ignore(),
|
||||
'editIcon' => ignore(),
|
||||
'url' => re('zzzz'),
|
||||
'title' => 'Zzzz'
|
||||
},
|
||||
],
|
||||
'epochDate' => ignore(),
|
||||
},
|
||||
],
|
||||
'viewTemplateVariables: sorted by story title'
|
||||
);
|
||||
|
||||
$creationDateSth->finish;
|
||||
done_testing();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue