diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 3a22bb433..cb56df887 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -24,6 +24,7 @@ Group matching. - fix [ 1397890 ] Can't click directly to page 2+ of a thread - fix [ 1328895 ] Page Redirect Asset Help File needs to be changed + - fix [ 1423815 ] snippet v6.8.5 6.8.5 - fix [ 1396957 ] Insufficient privileges check on the DataForm diff --git a/lib/WebGUI/Asset/Snippet.pm b/lib/WebGUI/Asset/Snippet.pm index 0473804ed..d0c04f2e5 100644 --- a/lib/WebGUI/Asset/Snippet.pm +++ b/lib/WebGUI/Asset/Snippet.pm @@ -139,7 +139,7 @@ Returns a toolbar with a set of icons that hyperlink to functions that delete, e sub getToolbar { my $self = shift; return undef if ($self->getToolbarState); - return $self->SUPER::getToolbar(); + return '

'.$self->SUPER::getToolbar().'

'; } #------------------------------------------------------------------- @@ -164,7 +164,7 @@ sub view { my $calledAsWebMethod = shift; my $output = $self->get("snippet"); WebGUI::Macro::process($self->session,\$output); - $output = '

'.$self->getToolbar.'

'.$output if ($self->session->var->get("adminOn") && !$calledAsWebMethod); + $output = $self->getToolbar.$output if ($self->session->var->get("adminOn") && !$calledAsWebMethod); return $output unless ($self->getValue("processAsTemplate")); return WebGUI::Asset::Template->processRaw($self->session, $output); } diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index 8815dd792..fe9a45299 100644 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -46,6 +46,7 @@ checkModule("LWP",5.80); checkModule("HTTP::Request",1.40); checkModule("HTTP::Headers",1.61); checkModule("Test::More",0.61,1); +checkModule("Test::MockObject",1.02,1); checkModule("Pod::Coverage",0.17,2); checkModule("Text::Balanced",1.95,1); checkModule("Digest::MD5",2.20); diff --git a/t/Session/DateTime.t b/t/Session/DateTime.t index 0057a097b..caa7c7ae1 100644 --- a/t/Session/DateTime.t +++ b/t/Session/DateTime.t @@ -15,7 +15,7 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; -use Test::More tests => 26; # increment this value for each test you create +use Test::More tests => 63; # increment this value for each test you create my $session = WebGUI::Test->session; @@ -52,3 +52,41 @@ is($session->datetime->secondsToTime(60*60*8),"08:00:00", "secondsToTime()"); is($session->datetime->setToEpoch("2001-08-16 08:00:00"), $wgbday, "setToEpoch()"); ok($session->datetime->time() > $wgbday,"time()"); is($session->datetime->timeToSeconds("08:00:00"), 60*60*8, "timeToSeconds()"); + + my %conversion = ( + "%c" => "%B", + "%C" => "%b", + "%d" => "%d", + "%D" => "%e", + "%h" => "%I", + "%H" => "%l", + "%j" => "%H", + "%J" => "%k", + "%m" => "%m", + "%M" => "%_varmonth_", + "%n" => "%M", + "%O" => "%z", + "%p" => "%P", + "%P" => "%p", + "%s" => "%S", + "%w" => "%A", + "%W" => "%a", + "%y" => "%Y", + "%Y" => "%y" + ); + +diag("check WebGUI to DateTime conversion"); +foreach my $wg (keys %conversion) { + is( $session->datetime->wgToDt($wg), $conversion{$wg}, + sprintf "WG to DT format conversion: %s => %s", $wg, $conversion{$wg}); +} + +%conversion = reverse %conversion; + +delete $conversion{'%_varmonth_'}; + +diag("check DateTime to WebGUI conversion"); +foreach my $dt (keys %conversion) { + is( $session->datetime->dtToWg($dt), $conversion{$dt}, + sprintf "WG to DT format conversion: %s => %s", $dt, $conversion{$dt}); +} diff --git a/t/i18n/label.t b/t/i18n/label.t index 2dddcfcd0..4bda69fa7 100644 --- a/t/i18n/label.t +++ b/t/i18n/label.t @@ -148,6 +148,12 @@ sub label_finder_pm { sub obj_finder_pm { next unless /\.pm$/; + warn "filename: $File::Find::name\n"; + if ($File::Find::name =~ m#(?:Help|i18n)/?$#) { + warn "Pruned $File::Find::name\n"; + $File::Find::prune=1; + return; + } open my $pmf, $_ or die "unable to open file $File::Find::name: $!\n"; my $libFile = '';