make sure get returns aspects _and_ properties.
This commit is contained in:
parent
9b3e21c123
commit
42b8237f1f
1 changed files with 13 additions and 1 deletions
14
t/Asset.t
14
t/Asset.t
|
|
@ -21,7 +21,7 @@ use Test::Deep;
|
|||
use Test::Exception;
|
||||
use WebGUI::Exception;
|
||||
|
||||
plan tests => 51;
|
||||
plan tests => 57;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
|
|
@ -274,3 +274,15 @@ my $session = WebGUI::Test->session;
|
|||
my $e = Exception::Class->caught;
|
||||
isa_ok $e, 'WebGUI::Error';
|
||||
}
|
||||
|
||||
{
|
||||
note "get gets WebGUI::Definition properties, and standard attributes";
|
||||
my $asset = WebGUI::Asset->new({session => $session, parentId => 'I have a parent'});
|
||||
is $asset->get('className'), 'WebGUI::Asset', 'get(property) works on className';
|
||||
is $asset->get('assetId'), $asset->assetId, '... works on assetId';
|
||||
is $asset->get('parentId'), 'I have a parent', '... works on parentId';
|
||||
my $properties = $asset->get();
|
||||
is $properties->{className}, 'WebGUI::Asset', 'get() works on className';
|
||||
is $properties->{assetId}, $asset->assetId, '... works on assetId';
|
||||
is $properties->{parentId}, 'I have a parent', '... works on parentId';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue