From 42b8237f1f5265f316631490efe76ec1fb16e0f4 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 25 Jan 2010 19:24:17 -0800 Subject: [PATCH] make sure get returns aspects _and_ properties. --- t/Asset.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/Asset.t b/t/Asset.t index a35e04fe9..eaa523f1f 100644 --- a/t/Asset.t +++ b/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'; +}