updated test for default ID
This commit is contained in:
parent
f1cabe7a25
commit
151deaf143
1 changed files with 28 additions and 7 deletions
|
|
@ -73,18 +73,39 @@ $templateId = '';
|
|||
my $templateNoId = $templateMock->mock('process','');
|
||||
$templateMock->set_always('getId', $templateId);
|
||||
$templateMock->mock('process', sub { $templateVars = $_[1]; } );
|
||||
my $error;
|
||||
|
||||
|
||||
{
|
||||
WebGUI::Test->mockAssetId($templateNoId, $templateMock);
|
||||
$error = WebGUI::Macro::PickLanguage::process($session,$templateMock->getId);
|
||||
|
||||
is($error,'Could not instanciate template with id []',"Empty template Id should return error");
|
||||
|
||||
WebGUI::Test->unmockAssetId($templateNoId);
|
||||
WebGUI::Test->mockAssetId($templateId, $templateMock);
|
||||
WebGUI::Macro::PickLanguage::process($session,$templateMock->getId);
|
||||
|
||||
cmp_deeply(
|
||||
$templateVars,
|
||||
{
|
||||
lang_loop => [
|
||||
{ 'language_url' => '?op=setLanguage;language=English',
|
||||
'language_lang' => 'English',
|
||||
'language_langAbbr' => 'en',
|
||||
'language_langAbbrLoc' => 'US',
|
||||
'language_langEng' => 'English'
|
||||
},
|
||||
],
|
||||
},
|
||||
'some template variables are created, when no templateId is passed on with the macro'
|
||||
);
|
||||
WebGUI::Test->unmockAssetId($templateId);
|
||||
}
|
||||
|
||||
|
||||
#{
|
||||
# WebGUI::Test->mockAssetId($templateNoId, $templateMock);
|
||||
# $error = WebGUI::Macro::PickLanguage::process($session,$templateMock->getId);
|
||||
#
|
||||
# is($error,'Could not instanciate template with id []',"Empty template Id should return error");
|
||||
#
|
||||
# WebGUI::Test->unmockAssetId($templateNoId);
|
||||
#}
|
||||
|
||||
#test for an incorrect template Id
|
||||
|
||||
$templateId = '1234567890123456789012';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue