diff --git a/t/Macro/AdminToggle.t b/t/Macro/AdminToggle.t index 2902d34cc..4f7214209 100644 --- a/t/Macro/AdminToggle.t +++ b/t/Macro/AdminToggle.t @@ -34,7 +34,6 @@ my @testSets = ( comment => 'Visitor sees nothing', userId => 1, adminStatus => 'off', - macroText => q!^AdminToggle();!, onText => q!!, offText => q!!, template => q!!, @@ -44,7 +43,6 @@ my @testSets = ( comment => 'Admin sees onText, default call', userId => 3, adminStatus => 'off', - macroText => q!^AdminToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -55,7 +53,6 @@ my @testSets = ( comment => 'Admin sees offText, default call', userId => 3, adminStatus => 'on', - macroText => q!^AdminToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -66,7 +63,6 @@ my @testSets = ( comment => 'Admin sees onText, custom text', userId => 3, adminStatus => 'off', - macroText => q!^AdminToggle("%s","%s");!, onText => 'Admin powers... Activate!', offText => 'Chillin, dude', template => q!!, @@ -77,7 +73,6 @@ my @testSets = ( comment => 'Admin sees offText, custom text', userId => 3, adminStatus => 'on', - macroText => q!^AdminToggle("%s","%s");!, onText => 'Admin powers... Activate!', offText => 'Chillin, dude', template => q!!, @@ -88,7 +83,6 @@ my @testSets = ( comment => 'Admin sees onText, custom text and template', userId => 3, adminStatus => 'off', - macroText => q!^AdminToggle("%s","%s","%s");!, onText => 'Admin powers... Activate!', offText => 'Chillin, dude', template => $template->get('url'), @@ -99,7 +93,6 @@ my @testSets = ( comment => 'Admin sees offText, custom text and template', userId => 3, adminStatus => 'on', - macroText => q!^AdminToggle("%s","%s","%s");!, onText => 'Admin powers... Activate!', offText => 'Chillin, dude', template => $template->get('url'), diff --git a/t/Macro/D_date.t b/t/Macro/D_date.t index e1c945d93..f29cc087b 100644 --- a/t/Macro/D_date.t +++ b/t/Macro/D_date.t @@ -21,9 +21,7 @@ use Data::Dumper; use Test::More; # increment this value for each test you create -my $macroText = '^D("%s",%s);'; my $wgbday = 997966800; -my $output; my @testSets = ( { diff --git a/t/Macro/EditableToggle.t b/t/Macro/EditableToggle.t index d54887f62..a1a2f91b2 100644 --- a/t/Macro/EditableToggle.t +++ b/t/Macro/EditableToggle.t @@ -34,7 +34,6 @@ my @testSets = ( userId => 1, adminStatus => 'off', asset => $homeAsset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -45,7 +44,6 @@ my @testSets = ( userId => 1, adminStatus => 'on', asset => $homeAsset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -56,7 +54,6 @@ my @testSets = ( userId => 3, adminStatus => 'off', asset => $homeAsset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -67,7 +64,6 @@ my @testSets = ( userId => 3, adminStatus => 'on', asset => $homeAsset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -78,7 +74,6 @@ my @testSets = ( userId => 3, adminStatus => 'off', asset => $asset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -89,7 +84,6 @@ my @testSets = ( userId => 3, adminStatus => 'on', asset => $asset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -100,7 +94,6 @@ my @testSets = ( userId => $users[0]->userId, adminStatus => 'off', asset => $asset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -111,7 +104,6 @@ my @testSets = ( userId => $users[0]->userId, adminStatus => 'on', asset => $asset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -122,7 +114,6 @@ my @testSets = ( userId => $users[1]->userId, adminStatus => 'off', asset => $asset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -133,7 +124,6 @@ my @testSets = ( userId => $users[1]->userId, adminStatus => 'on', asset => $asset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -144,7 +134,6 @@ my @testSets = ( userId => $users[2]->userId, adminStatus => 'off', asset => $asset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -155,7 +144,6 @@ my @testSets = ( userId => $users[2]->userId, adminStatus => 'on', asset => $asset, - macroText => q!^EditableToggle();!, onText => $i18n->get(516), offText => $i18n->get(517), template => q!!, @@ -166,7 +154,6 @@ my @testSets = ( userId => $users[2]->userId, adminStatus => 'off', asset => $asset, - macroText => q!^EditableToggle("%s","%s");!, onText => 'Admin powers... Activate!', offText => 'Chillin, dude', template => q!!, @@ -177,7 +164,6 @@ my @testSets = ( userId => $users[2]->userId, adminStatus => 'on', asset => $asset, - macroText => q!^EditableToggle("%s","%s");!, onText => 'Admin powers... Activate!', offText => 'Chillin, dude', template => q!!, @@ -188,7 +174,6 @@ my @testSets = ( userId => $users[2]->userId, adminStatus => 'on', asset => $asset, - macroText => q!^EditableToggle("%s","%s","%s");!, onText => 'Admin powers... Activate!', offText => 'Chillin, dude', template => $asset->get('url'), diff --git a/t/Macro/FileUrl.t b/t/Macro/FileUrl.t index dd67c5457..ce24ced0b 100644 --- a/t/Macro/FileUrl.t +++ b/t/Macro/FileUrl.t @@ -23,7 +23,11 @@ use Test::More; # increment this value for each test you create my $session = WebGUI::Test->session; my $i18n = WebGUI::International->new($session, 'Macro_FileUrl'); -##Add more Asset configurations here. +##Add more Asset configurations here. Each Asset is created and a reference +##is put into the "asset" key of the hash. +##The URL for the file the Asset contains is calculated and put +##in the "fileUrl" key of the hash. + my @testSets = ( { comment => 'File Asset works with FileUrl', @@ -83,8 +87,6 @@ my @testSets = ( plan tests => scalar(@testSets) + 1; -my $macroText = '^FileUrl("%s");'; - my $homeAsset = WebGUI::Asset->getDefault($session); my $versionTag; @@ -100,8 +102,7 @@ foreach my $testSet (@testSets) { } } -my $output = sprintf $macroText, "non-existant-url"; -WebGUI::Macro::process($session, \$output); +my $output = WebGUI::Macro::FileUrl::process($session, "non-existant-url"); is($output, $i18n->get('invalid url'), "Non-existant url returns error message"); sub setupTest { diff --git a/t/Macro/International.t b/t/Macro/International.t index 82df1649d..9d5990896 100644 --- a/t/Macro/International.t +++ b/t/Macro/International.t @@ -21,9 +21,6 @@ use Test::More; # increment this value for each test you create my $session = WebGUI::Test->session; -my $macroText = '^International("%s","%s");'; -my $output; - my @testSets = ( { input => ['macroName', 'Macro_International'], diff --git a/t/Macro/Spacer.t b/t/Macro/Spacer.t index f28849afb..a95c20fb9 100644 --- a/t/Macro/Spacer.t +++ b/t/Macro/Spacer.t @@ -25,25 +25,21 @@ my $session = WebGUI::Test->session; my @testSets = ( { comment => '5x5', - macroText => q!^Spacer("%s","%s");!, width => 5, height => 5, }, { comment => '10x3', - macroText => q!^Spacer("%s","%s");!, width => 10, height => 3, }, { comment => 'width only', - macroText => q!^Spacer("%s");!, width => 11, height => '', }, { comment => 'height only', - macroText => q!^Spacer("%s","%s");!, width => '', height => 7, },