From 61eb59c7f8434d7afe6b2bf8c29b83a3b09cc2b2 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 2 Aug 2006 15:39:23 +0000 Subject: [PATCH] bug fixes and new tests --- docs/changelog/7.x.x.txt | 4 +++ lib/WebGUI/HTMLForm.pm | 21 +++++++++---- .../Workflow/Activity/_activity.skeleton | 3 +- sbin/testEnvironment.pl | 1 + t/Asset/AssetLineage.t | 30 +++++++++++++++++++ 5 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 t/Asset/AssetLineage.t diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2c3760b1f..61c4b60f3 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,6 +4,10 @@ - fixed a bug where the Include macro could be used to read WebGUI config files. - fix: new by webgui: 31 months in a year + - Several new tests. + - Many POD fixes. + - fix: URI::Escape missing from testEnvironment.pl + 7.0.3 - Fixed a problem with the 7.0.0-7.0.1 upgrade relating to internationalized diff --git a/lib/WebGUI/HTMLForm.pm b/lib/WebGUI/HTMLForm.pm index 2d3a06a86..0cbd16002 100644 --- a/lib/WebGUI/HTMLForm.pm +++ b/lib/WebGUI/HTMLForm.pm @@ -149,29 +149,38 @@ sub fieldSetStart { #------------------------------------------------------------------- -=head2 new ( [ action, method, extras, enctype, tableExtras ] ) +=head2 new ( session [ properties ] ) Constructor. -=head3 action + +=head3 session + +A reference to the session. + +=head3 properties + +A hash of parameters to modify the defaults of the form. + +=head4 action The Action URL for the form information to be submitted to. This defaults to the current page. -=head3 method +=head4 method The form's submission method. This defaults to "POST" and probably shouldn't be changed. -=head3 extras +=head4 extras If you want to add anything special to your form like javascript actions, or stylesheet information, you'd add it in here as follows: '"name"="myForm" onchange="myForm.submit()"' -=head3 enctype +=head4 enctype The encapsulation type for this form. This defaults to "multipart/form-data" and should probably never be changed. -=head3 tableExtras +=head4 tableExtras If you want to add anything special to the form's table like a name or stylesheet information, you'd add it in here as follows: diff --git a/lib/WebGUI/Workflow/Activity/_activity.skeleton b/lib/WebGUI/Workflow/Activity/_activity.skeleton index 0a613176a..f70cc0406 100644 --- a/lib/WebGUI/Workflow/Activity/_activity.skeleton +++ b/lib/WebGUI/Workflow/Activity/_activity.skeleton @@ -49,12 +49,13 @@ sub definition { my $class = shift; my $session = shift; my $definition = shift; + my $i18n = WebGUI::International->new($session, "Activity_Skeleton"); push(@{$definition}, { name=>$i18n->get("topicName"), properties=> { someField => { fieldType=>"integer", - label=>"Some Field" + label=>"Some Field", defaultValue=>0, hoverHelp=>"Hover help for some field." }, diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index c9e15b971..c08b7a2ad 100644 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -89,6 +89,7 @@ checkModule("POE::Component::Client::HTTP", 0.77); checkModule("Data::Structure::Util",0.11); checkModule("Apache2::Request",2.06); checkModule("Cache::Memcached",1.15,2); +checkModule("URI::Escape","3.28"); checkModule("POSIX"); checkModule("List::Util"); checkModule("Color::Calc"); diff --git a/t/Asset/AssetLineage.t b/t/Asset/AssetLineage.t new file mode 100644 index 000000000..91652bf04 --- /dev/null +++ b/t/Asset/AssetLineage.t @@ -0,0 +1,30 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2006 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/../lib"; + +use WebGUI::Test; +use WebGUI::Session; + +use WebGUI::Asset; +use Test::More tests => 2; # increment this value for each test you create + +# Test the methods in WebGUI::AssetLineage + +my $session = WebGUI::Test->session; + +my $asset = WebGUI::Asset->getImportNode($session); + +is($asset->formatRank(76), "000076", "formatRank()"); +is($asset->getLineageLength(), (length($asset->get("lineage")) / 6), "getLineageLength()"); + +