Add T::C tests for File and Snippet.
This commit is contained in:
parent
a3aeae9a4e
commit
3b0e89341d
4 changed files with 71 additions and 3 deletions
|
|
@ -11,5 +11,7 @@
|
|||
use lib 'tests';
|
||||
|
||||
use Test::AssetBase;
|
||||
use Test::Asset::File;
|
||||
use Test::Asset::Snippet;
|
||||
|
||||
Test::Class->runtests;
|
||||
|
|
|
|||
30
t/tests/Test/Asset/File.pm
Normal file
30
t/tests/Test/Asset/File.pm
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package Test::Asset::File;
|
||||
#-------------------------------------------------------------------
|
||||
# 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 WebGUI::Test;
|
||||
|
||||
use Test::More;
|
||||
use Test::Deep;
|
||||
use Test::Exception;
|
||||
|
||||
sub class {
|
||||
return qw/WebGUI::Asset::File/;
|
||||
}
|
||||
|
||||
sub list_of_tables {
|
||||
return [qw/assetData FileAsset/];
|
||||
}
|
||||
|
||||
1;
|
||||
34
t/tests/Test/Asset/Snippet.pm
Normal file
34
t/tests/Test/Asset/Snippet.pm
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package Test::Asset::Snippet;
|
||||
#-------------------------------------------------------------------
|
||||
# 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 WebGUI::Test;
|
||||
|
||||
use Test::More;
|
||||
use Test::Deep;
|
||||
use Test::Exception;
|
||||
|
||||
sub class {
|
||||
return qw/WebGUI::Asset::Snippet/;
|
||||
}
|
||||
|
||||
sub uiLevel {
|
||||
return 5;
|
||||
}
|
||||
|
||||
sub list_of_tables {
|
||||
return [qw/assetData snippet/];
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
@ -40,7 +40,8 @@ sub _00_init : Test(startup) {
|
|||
my $test = shift;
|
||||
my $session = WebGUI::Test->session;
|
||||
$test->{_session} = $session;
|
||||
eval { require $test->class; };
|
||||
note "Loading ". $test->class;
|
||||
eval { WebGUI::Asset->loadModule($test->class); };
|
||||
}
|
||||
|
||||
sub _constructor : Test(4) {
|
||||
|
|
@ -149,7 +150,8 @@ sub uiLevel : Test(1) {
|
|||
my $test = shift;
|
||||
my $session = $test->session;
|
||||
note "uiLevel";
|
||||
is $test->class->meta->uiLevel, $test->assetUiLevel, 'asset uiLevel check';
|
||||
my $asset = $test->class->new({session => $session});
|
||||
is $asset->uiLevel, $test->assetUiLevel, 'asset uiLevel check';
|
||||
}
|
||||
|
||||
sub write_update : Test(8) {
|
||||
|
|
@ -273,7 +275,7 @@ sub addRevision : Test(6) {
|
|||
$session->db->write("delete from assetData where assetId like 'wg8TestAsset00000%'");
|
||||
}
|
||||
|
||||
sub addRevision : Test(2) {
|
||||
sub newByPropertyHashRef : Test(2) {
|
||||
my $test = shift;
|
||||
my $session = $test->session;
|
||||
note "newByPropertyHashRef";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue