Uniqueness check on attribute names in get_property_list. Add tests for that, and for get_attributes

This commit is contained in:
Colin Kuskie 2009-12-11 11:56:16 -08:00
parent 334f3414c3
commit 059bd6761d
2 changed files with 35 additions and 1 deletions

View file

@ -115,6 +115,18 @@ my $called_getProperties;
package main;
cmp_bag(
[ map {$_->name} WGT::Class::AlsoAsset->meta->get_attributes ],
[qw/property1 property2 property3/],
'get_attributes returns attributes for my class'
);
cmp_bag(
[ map {$_->name} WGT::Class::Asset::Snippet->meta->get_attributes ],
[qw/property10 property11/],
'...even in a subclass'
);
cmp_deeply(
WGT::Class::Asset::Snippet->getProperties,
[qw/property1 property2 property3 property10 property11/],
@ -122,3 +134,23 @@ my $called_getProperties;
);
}
{
package WGT::Class::Asset::NotherOne;
use WebGUI::Definition::Asset;
extends 'WGT::Class::AlsoAsset';
attribute tableName => 'snippet';
property 'property10' => ();
property 'property1' => ();
package main;
cmp_deeply(
WGT::Class::Asset::NotherOne->getProperties,
[qw/property1 property2 property3 property10/],
'checking inheritance of properties by name, insertion order with an overridden property'
);
}