Rework all tests to call the Macro's process subroutine directly.
Add RootTitle.t test. Broke up the SettingMacros.t test into individual tests.
This commit is contained in:
parent
60e9523f7b
commit
6aab9a6eec
32 changed files with 433 additions and 623 deletions
|
|
@ -15,26 +15,22 @@ use strict;
|
|||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Macro::Hash_userId;
|
||||
use WebGUI::Session;
|
||||
use Data::Dumper;
|
||||
use WebGUI::Macro_Config;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
use Test::More; # increment this value for each test you create
|
||||
|
||||
my @added_macros = ();
|
||||
push @added_macros, WebGUI::Macro_Config::enable_macro($session, '#', 'Hash_userId');
|
||||
|
||||
my @testSets = (
|
||||
{
|
||||
userId => 1,
|
||||
comment => q!Visitor!,
|
||||
userId => 1,
|
||||
comment => q!Visitor!,
|
||||
},
|
||||
{
|
||||
userId => 3,
|
||||
comment => q!Admin!,
|
||||
userId => 3,
|
||||
comment => q!Admin!,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -44,14 +40,6 @@ plan tests => $numTests;
|
|||
|
||||
foreach my $testSet (@testSets) {
|
||||
$session->user({userId => $testSet->{userId}});
|
||||
my $output = "^#;";
|
||||
WebGUI::Macro::process($session, \$output);
|
||||
my $output = WebGUI::Macro::Hash_userId::process($session);
|
||||
is($output, $testSet->{userId}, 'testing '.$testSet->{comment});
|
||||
}
|
||||
|
||||
END {
|
||||
foreach my $macro (@added_macros) {
|
||||
next unless $macro;
|
||||
$session->config->deleteFromHash("macros", $macro);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue