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','');
|
my $templateNoId = $templateMock->mock('process','');
|
||||||
$templateMock->set_always('getId', $templateId);
|
$templateMock->set_always('getId', $templateId);
|
||||||
$templateMock->mock('process', sub { $templateVars = $_[1]; } );
|
$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->mockAssetId($templateId, $templateMock);
|
||||||
|
WebGUI::Macro::PickLanguage::process($session,$templateMock->getId);
|
||||||
|
|
||||||
WebGUI::Test->unmockAssetId($templateNoId);
|
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
|
#test for an incorrect template Id
|
||||||
|
|
||||||
$templateId = '1234567890123456789012';
|
$templateId = '1234567890123456789012';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue