added tests for newByHashref constructor
This commit is contained in:
parent
a48a4dc3e3
commit
0703c41165
1 changed files with 10 additions and 4 deletions
|
|
@ -17,7 +17,7 @@ use WebGUI::Session;
|
||||||
use WebGUI::Asset;
|
use WebGUI::Asset;
|
||||||
use WebGUI::Asset::Wobject::Navigation;
|
use WebGUI::Asset::Wobject::Navigation;
|
||||||
|
|
||||||
use Test::More tests => 13; # increment this value for each test you create
|
use Test::More tests => 15; # increment this value for each test you create
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -33,6 +33,15 @@ my $asset = WebGUI::Asset->new($session, $assetId, 'WebGUI::Asset::Wobject::Navi
|
||||||
is (ref $asset, 'WebGUI::Asset::Wobject::Navigation','new constructor explicit - ref check');
|
is (ref $asset, 'WebGUI::Asset::Wobject::Navigation','new constructor explicit - ref check');
|
||||||
is ($asset->getId, $assetId, 'new constructor explicit - returns correct asset');
|
is ($asset->getId, $assetId, 'new constructor explicit - returns correct asset');
|
||||||
|
|
||||||
|
# - new by hashref properties
|
||||||
|
$asset = undef;
|
||||||
|
$asset = WebGUI::Asset->newByPropertyHashRef($session, {
|
||||||
|
className=>"WebGUI::Asset::Wobject::Navigation",
|
||||||
|
assetId=>$assetId
|
||||||
|
});
|
||||||
|
is (ref $asset, 'WebGUI::Asset::Wobject::Navigation', 'new constructor newByHashref - ref check');
|
||||||
|
is ($asset->getId, $assetId, 'new constructor newByHashref - returns correct asset');
|
||||||
|
|
||||||
# - implicit class
|
# - implicit class
|
||||||
$asset = undef;
|
$asset = undef;
|
||||||
$asset = WebGUI::Asset::Wobject::Navigation->new($session, $assetId);
|
$asset = WebGUI::Asset::Wobject::Navigation->new($session, $assetId);
|
||||||
|
|
@ -74,6 +83,3 @@ my $rootAsset = WebGUI::Asset->getRoot($session);
|
||||||
isa_ok($rootAsset, 'WebGUI::Asset');
|
isa_ok($rootAsset, 'WebGUI::Asset');
|
||||||
is($rootAsset->getId, 'PBasset000000000000001', 'Root Asset ID check');
|
is($rootAsset->getId, 'PBasset000000000000001', 'Root Asset ID check');
|
||||||
|
|
||||||
# TODO
|
|
||||||
# Test the newByPropertiesHashRef Constructor
|
|
||||||
#
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue