add ability to show metadata values in head blocks.
This commit is contained in:
parent
c15ba6147f
commit
36eb8db8fc
43 changed files with 96 additions and 49 deletions
|
|
@ -23,7 +23,7 @@ use WebGUI::VersionTag;
|
|||
|
||||
use Test::More; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
plan tests => 12;
|
||||
plan tests => 13;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
$session->user({userId => 3});
|
||||
|
|
@ -189,6 +189,31 @@ cmp_deeply(
|
|||
'Snippet does not have a value, yet'
|
||||
);
|
||||
|
||||
####################################################
|
||||
#
|
||||
# getMetaDataAsTemplateVariables
|
||||
#
|
||||
####################################################
|
||||
|
||||
# add another field for comparison
|
||||
$folder->addMetaDataField('new', 'book', '', 'Favorite book', 'radioList', "1984\nDune\nLord of the Rings\nFoundation Trilogy");
|
||||
|
||||
# set it; need to update $foMetaData and $byName.
|
||||
$foMetaData = $folder->getMetaDataFields;
|
||||
$byName = buildNameIndex($foMetaData);
|
||||
$folder->updateMetaData( $byName->{'book'}, '1984' );
|
||||
|
||||
# check that they're equal
|
||||
cmp_deeply(
|
||||
$folder->getMetaDataAsTemplateVariables,
|
||||
{
|
||||
'book' => '1984',
|
||||
'sport' => 'underwaterHockey',
|
||||
'searchEngine' => undef,
|
||||
},
|
||||
'getMetaDataAsTemplateVariables returns proper values for folder'
|
||||
);
|
||||
|
||||
sub buildNameIndex {
|
||||
my ($fidStruct) = @_;
|
||||
my $nameStruct;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue