More Test::Class tests for AssetBase.pm
This commit is contained in:
parent
f5f1839945
commit
006bda8dd0
1 changed files with 19 additions and 4 deletions
|
|
@ -32,6 +32,10 @@ sub assetUiLevel {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub list_of_tables {
|
||||||
|
return [qw/assetData/];
|
||||||
|
}
|
||||||
|
|
||||||
sub _00_init : Test(startup) {
|
sub _00_init : Test(startup) {
|
||||||
my $test = shift;
|
my $test = shift;
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
@ -39,7 +43,7 @@ sub _00_init : Test(startup) {
|
||||||
eval { require $test->class; };
|
eval { require $test->class; };
|
||||||
}
|
}
|
||||||
|
|
||||||
sub constructor : Test(4) {
|
sub _constructor : Test(4) {
|
||||||
my $test = shift;
|
my $test = shift;
|
||||||
my $session = $test->session;
|
my $session = $test->session;
|
||||||
my $asset = $test->class->new({session => $session});
|
my $asset = $test->class->new({session => $session});
|
||||||
|
|
@ -194,10 +198,21 @@ sub keywords : Test(3) {
|
||||||
className => $test->class,
|
className => $test->class,
|
||||||
});
|
});
|
||||||
addToCleanup($asset);
|
addToCleanup($asset);
|
||||||
can_ok($asset, 'keywords');
|
can_ok $asset, 'keywords';
|
||||||
$asset->keywords('chess set');
|
$asset->keywords('chess set');
|
||||||
is ($asset->keywords, 'chess set', 'set and get of keywords via direct accessor');
|
is $asset->keywords, 'chess set', 'set and get of keywords via direct accessor';
|
||||||
#is ($asset->get('keywords'), 'chess set', 'via get method');
|
is $asset->get('keywords'), 'chess set', 'via get method';
|
||||||
|
}
|
||||||
|
|
||||||
|
sub keywords : Test(1) {
|
||||||
|
my $test = shift;
|
||||||
|
note "get_tables";
|
||||||
|
my @tables = $test->class->meta->get_tables;
|
||||||
|
cmp_deeply(
|
||||||
|
\@tables,
|
||||||
|
$test->list_of_tables,
|
||||||
|
'Set of tables for properties is correct'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue