From 8209de79781d1237002a39bf044c257291f985d5 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 12 Mar 2010 08:41:04 -0800 Subject: [PATCH] Add tests for most other wobjects. Block broken code in Role/Asset/Comments. Refactor run_asset.t --- lib/WebGUI/Role/Asset/Comments.pm | 82 +++++++++---------- t/run_asset.t | 36 +------- t/tests/Test/Asset/Wobject/Collaboration | 33 ++++++++ t/tests/Test/Asset/Wobject/Dashboard.pm | 33 ++++++++ t/tests/Test/Asset/Wobject/HttpProxy | 33 ++++++++ t/tests/Test/Asset/Wobject/Navigation.pm | 29 +++++++ t/tests/Test/Asset/Wobject/Poll.pm | 29 +++++++ t/tests/Test/Asset/Wobject/ProjectManager.pm | 29 +++++++ t/tests/Test/Asset/Wobject/SQLReport.pm | 33 ++++++++ t/tests/Test/Asset/Wobject/Search.pm | 29 +++++++ t/tests/Test/Asset/Wobject/Shelf.pm | 29 +++++++ t/tests/Test/Asset/Wobject/StockData.pm | 29 +++++++ t/tests/Test/Asset/Wobject/StoryArchive.pm | 29 +++++++ t/tests/Test/Asset/Wobject/StoryTopic.pm | 29 +++++++ t/tests/Test/Asset/Wobject/Survey | 33 ++++++++ t/tests/Test/Asset/Wobject/Survey.pm | 29 +++++++ .../Test/Asset/Wobject/SyndicatedContent.pm | 33 ++++++++ t/tests/Test/Asset/Wobject/Thingy.pm | 29 +++++++ t/tests/Test/Asset/Wobject/TimeTracking.pm | 29 +++++++ t/tests/Test/Asset/Wobject/UserList.pm | 29 +++++++ t/tests/Test/Asset/Wobject/WeatherData.pm | 29 +++++++ t/tests/Test/Asset/Wobject/WikiMaster.pm | 29 +++++++ t/tests/Test/AssetBase.pm | 4 +- 23 files changed, 648 insertions(+), 78 deletions(-) create mode 100644 t/tests/Test/Asset/Wobject/Collaboration create mode 100644 t/tests/Test/Asset/Wobject/Dashboard.pm create mode 100644 t/tests/Test/Asset/Wobject/HttpProxy create mode 100644 t/tests/Test/Asset/Wobject/Navigation.pm create mode 100644 t/tests/Test/Asset/Wobject/Poll.pm create mode 100644 t/tests/Test/Asset/Wobject/ProjectManager.pm create mode 100644 t/tests/Test/Asset/Wobject/SQLReport.pm create mode 100644 t/tests/Test/Asset/Wobject/Search.pm create mode 100644 t/tests/Test/Asset/Wobject/Shelf.pm create mode 100644 t/tests/Test/Asset/Wobject/StockData.pm create mode 100644 t/tests/Test/Asset/Wobject/StoryArchive.pm create mode 100644 t/tests/Test/Asset/Wobject/StoryTopic.pm create mode 100644 t/tests/Test/Asset/Wobject/Survey create mode 100644 t/tests/Test/Asset/Wobject/Survey.pm create mode 100644 t/tests/Test/Asset/Wobject/SyndicatedContent.pm create mode 100644 t/tests/Test/Asset/Wobject/Thingy.pm create mode 100644 t/tests/Test/Asset/Wobject/TimeTracking.pm create mode 100644 t/tests/Test/Asset/Wobject/UserList.pm create mode 100644 t/tests/Test/Asset/Wobject/WeatherData.pm create mode 100644 t/tests/Test/Asset/Wobject/WikiMaster.pm diff --git a/lib/WebGUI/Role/Asset/Comments.pm b/lib/WebGUI/Role/Asset/Comments.pm index c155d2f7b..c36875e3b 100644 --- a/lib/WebGUI/Role/Asset/Comments.pm +++ b/lib/WebGUI/Role/Asset/Comments.pm @@ -187,23 +187,23 @@ sub deleteComment { } } -#------------------------------------------------------------------- - -=head2 get () - -See SUPER::get(). Extends the get() method to automatically decode the comments field into a Perl hash structure. - -=cut - -sub get { - my $self = shift; - my $param = shift; - if ($param eq 'comments') { - return JSON->new->decode($self->next::method('comments')||'[]'); - } - return $self->next::method($param, @_); -} - +##------------------------------------------------------------------- +# +#=head2 get () +# +#See SUPER::get(). Extends the get() method to automatically decode the comments field into a Perl hash structure. +# +#=cut +# +#sub get { +# my $self = shift; +# my $param = shift; +# if ($param eq 'comments') { +# return JSON->new->decode($self->next::method('comments')||'[]'); +# } +# return $self->next::method($param, @_); +#} +# #------------------------------------------------------------------- =head2 getAverageCommentRatingIcon () @@ -279,30 +279,30 @@ sub getKarmaAmountPerComment { } -#------------------------------------------------------------------- - -=head2 update () - -See SUPER::update(). Extends the update() method to encode the comments field into something storable in the database. - -=cut - -sub update { - my $self = shift; - my $properties = shift; - if (exists $properties->{comments}) { - my $comments = $properties->{comments}; - if (ref $comments ne 'ARRAY') { - $comments = eval{JSON->new->decode($comments)}; - if (WebGUI::Error->caught || ref $comments ne 'ARRAY') { - $comments = []; - } - } - $properties->{comments} = JSON->new->encode($comments); - } - $self->next::method($properties, @_); -} - +##------------------------------------------------------------------- +# +#=head2 update () +# +#See SUPER::update(). Extends the update() method to encode the comments field into something storable in the database. +# +#=cut +# +#sub update { +# my $self = shift; +# my $properties = shift; +# if (exists $properties->{comments}) { +# my $comments = $properties->{comments}; +# if (ref $comments ne 'ARRAY') { +# $comments = eval{JSON->new->decode($comments)}; +# if (WebGUI::Error->caught || ref $comments ne 'ARRAY') { +# $comments = []; +# } +# } +# $properties->{comments} = JSON->new->encode($comments); +# } +# $self->next::method($properties, @_); +#} +# #------------------------------------------------------------------- =head2 www_addComment () diff --git a/t/run_asset.t b/t/run_asset.t index 567f24fc9..3a3b10a73 100644 --- a/t/run_asset.t +++ b/t/run_asset.t @@ -8,39 +8,5 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -use lib 'tests'; - -use Test::AssetBase; -use Test::Asset::File; -use Test::Asset::File::Image; -use Test::Asset::File::ZipArchive; -use Test::Asset::File::GalleryFile; -use Test::Asset::Redirect; -use Test::Asset::RichEdit; -use Test::Asset::Shortcut; -use Test::Asset::Sku; -use Test::Asset::Snippet; -use Test::Asset::Template; -use Test::Asset::Wobject; -use Test::Asset::Wobject::Article; -use Test::Asset::Wobject::Calendar; -use Test::Asset::Wobject::Carousel; -use Test::Asset::Wobject::Collaboration; -use Test::Asset::Wobject::DataForm; -use Test::Asset::Wobject::DataTable; -use Test::Asset::Wobject::EventManagementSystem; -use Test::Asset::Wobject::Folder; -use Test::Asset::Wobject::Gallery; -use Test::Asset::Wobject::GalleryAlbum; -use Test::Asset::Wobject::HttpProxy; -use Test::Asset::Wobject::InOutBoard; -use Test::Asset::Wobject::Layout; -use Test::Asset::Wobject::Map; -use Test::Asset::Wobject::Matrix; -use Test::Asset::Wobject::MessageBoard; -use Test::Asset::Wobject::MultiSearch; -use Test::Asset::Wobject::Navigation; -use Test::Asset::Wobject::Poll; -use Test::Asset::Wobject::ProjectManager; - +use Test::Class::Load qw/tests/; Test::Class->runtests; diff --git a/t/tests/Test/Asset/Wobject/Collaboration b/t/tests/Test/Asset/Wobject/Collaboration new file mode 100644 index 000000000..ccb16208f --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Collaboration @@ -0,0 +1,33 @@ +package Test::Asset::Wobject::HttpProxy; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::HttpProxy/; +} + +sub assetUiLevel { + return 5; +} + +sub list_of_tables { + return [qw/assetData wobject HttpProxy/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/Dashboard.pm b/t/tests/Test/Asset/Wobject/Dashboard.pm new file mode 100644 index 000000000..ccb16208f --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Dashboard.pm @@ -0,0 +1,33 @@ +package Test::Asset::Wobject::HttpProxy; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::HttpProxy/; +} + +sub assetUiLevel { + return 5; +} + +sub list_of_tables { + return [qw/assetData wobject HttpProxy/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/HttpProxy b/t/tests/Test/Asset/Wobject/HttpProxy new file mode 100644 index 000000000..ccb16208f --- /dev/null +++ b/t/tests/Test/Asset/Wobject/HttpProxy @@ -0,0 +1,33 @@ +package Test::Asset::Wobject::HttpProxy; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::HttpProxy/; +} + +sub assetUiLevel { + return 5; +} + +sub list_of_tables { + return [qw/assetData wobject HttpProxy/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/Navigation.pm b/t/tests/Test/Asset/Wobject/Navigation.pm new file mode 100644 index 000000000..1ca0e3ff7 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Navigation.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::Navigation; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::Navigation/; +} + +sub list_of_tables { + return [qw/assetData wobject Navigation/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/Poll.pm b/t/tests/Test/Asset/Wobject/Poll.pm new file mode 100644 index 000000000..ac45bade2 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Poll.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::Poll; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::Poll/; +} + +sub list_of_tables { + return [qw/assetData wobject Poll/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/ProjectManager.pm b/t/tests/Test/Asset/Wobject/ProjectManager.pm new file mode 100644 index 000000000..cecb2c39c --- /dev/null +++ b/t/tests/Test/Asset/Wobject/ProjectManager.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::ProjectManager; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::ProjectManager/; +} + +sub list_of_tables { + return [qw/assetData wobject PM_wobject/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/SQLReport.pm b/t/tests/Test/Asset/Wobject/SQLReport.pm new file mode 100644 index 000000000..78377e820 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/SQLReport.pm @@ -0,0 +1,33 @@ +package Test::Asset::Wobject::SQLReport; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::SQLReport/; +} + +sub assetUiLevel { + return 5; +} + +sub list_of_tables { + return [qw/assetData wobject SQLReport/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/Search.pm b/t/tests/Test/Asset/Wobject/Search.pm new file mode 100644 index 000000000..5c6c142a5 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Search.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::Search; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::Search/; +} + +sub list_of_tables { + return [qw/assetData wobject search/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/Shelf.pm b/t/tests/Test/Asset/Wobject/Shelf.pm new file mode 100644 index 000000000..eb27fd6f2 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Shelf.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::Shelf; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::Shelf/; +} + +sub list_of_tables { + return [qw/assetData wobject Shelf/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/StockData.pm b/t/tests/Test/Asset/Wobject/StockData.pm new file mode 100644 index 000000000..4064fe8f8 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/StockData.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::StockData; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::StockData/; +} + +sub list_of_tables { + return [qw/assetData wobject StockData/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/StoryArchive.pm b/t/tests/Test/Asset/Wobject/StoryArchive.pm new file mode 100644 index 000000000..fc83b8c18 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/StoryArchive.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::StoryArchive; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::StoryArchive/; +} + +sub list_of_tables { + return [qw/assetData wobject StoryArchive assetAspectRssFeed/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/StoryTopic.pm b/t/tests/Test/Asset/Wobject/StoryTopic.pm new file mode 100644 index 000000000..3a367727e --- /dev/null +++ b/t/tests/Test/Asset/Wobject/StoryTopic.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::StoryTopic; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::StoryTopic/; +} + +sub list_of_tables { + return [qw/assetData wobject StoryTopic assetAspectRssFeed/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/Survey b/t/tests/Test/Asset/Wobject/Survey new file mode 100644 index 000000000..ccb16208f --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Survey @@ -0,0 +1,33 @@ +package Test::Asset::Wobject::HttpProxy; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::HttpProxy/; +} + +sub assetUiLevel { + return 5; +} + +sub list_of_tables { + return [qw/assetData wobject HttpProxy/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/Survey.pm b/t/tests/Test/Asset/Wobject/Survey.pm new file mode 100644 index 000000000..be8148170 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Survey.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::Survey; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::Survey/; +} + +sub list_of_tables { + return [qw/assetData wobject Survey/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/SyndicatedContent.pm b/t/tests/Test/Asset/Wobject/SyndicatedContent.pm new file mode 100644 index 000000000..b2a93c309 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/SyndicatedContent.pm @@ -0,0 +1,33 @@ +package Test::Asset::Wobject::SyndicatedContent; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::SyndicatedContent/; +} + +sub assetUiLevel { + return 6; +} + +sub list_of_tables { + return [qw/assetData wobject SyndicatedContent assetAspectRssFeed/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/Thingy.pm b/t/tests/Test/Asset/Wobject/Thingy.pm new file mode 100644 index 000000000..ade576f8b --- /dev/null +++ b/t/tests/Test/Asset/Wobject/Thingy.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::Thingy; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::Thingy/; +} + +sub list_of_tables { + return [qw/assetData wobject Thingy/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/TimeTracking.pm b/t/tests/Test/Asset/Wobject/TimeTracking.pm new file mode 100644 index 000000000..3530c2617 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/TimeTracking.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::TimeTracking; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::TimeTracking/; +} + +sub list_of_tables { + return [qw/assetData wobject TT_wobject/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/UserList.pm b/t/tests/Test/Asset/Wobject/UserList.pm new file mode 100644 index 000000000..b01a6c864 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/UserList.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::UserList; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::UserList/; +} + +sub list_of_tables { + return [qw/assetData wobject UserList/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/WeatherData.pm b/t/tests/Test/Asset/Wobject/WeatherData.pm new file mode 100644 index 000000000..663315c3d --- /dev/null +++ b/t/tests/Test/Asset/Wobject/WeatherData.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::WeatherData; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::WeatherData/; +} + +sub list_of_tables { + return [qw/assetData wobject WeatherData/]; +} + +1; diff --git a/t/tests/Test/Asset/Wobject/WikiMaster.pm b/t/tests/Test/Asset/Wobject/WikiMaster.pm new file mode 100644 index 000000000..5a98ba857 --- /dev/null +++ b/t/tests/Test/Asset/Wobject/WikiMaster.pm @@ -0,0 +1,29 @@ +package Test::Asset::Wobject::WikiMaster; +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 lib "$FindBin::Bin/lib"; + +use base qw/Test::AssetBase/; + +use Test::More; +use Test::Deep; +use Test::Exception; + +sub class { + return qw/WebGUI::Asset::Wobject::WikiMaster/; +} + +sub list_of_tables { + return [qw/assetData wobject WikiMaster assetAspectRssFeed assetAspectComments assetAspect_Subscribable/]; +} + +1; diff --git a/t/tests/Test/AssetBase.pm b/t/tests/Test/AssetBase.pm index ea863815e..4b96fd459 100644 --- a/t/tests/Test/AssetBase.pm +++ b/t/tests/Test/AssetBase.pm @@ -206,11 +206,11 @@ sub keywords : Test(3) { is $asset->get('keywords'), 'chess set', 'via get method'; } -sub keywords : Test(1) { +sub get_tables : Test(1) { my $test = shift; note "get_tables"; my @tables = $test->class->meta->get_tables; - cmp_deeply( + cmp_bag( \@tables, $test->list_of_tables, 'Set of tables for properties is correct'