rework test to handle loss of getProperty. use find_attribute_by_name instead.
This commit is contained in:
parent
42b8237f1f
commit
9155f70555
1 changed files with 3 additions and 7 deletions
|
|
@ -68,14 +68,10 @@ use WebGUI::Test;
|
|||
}
|
||||
|
||||
::is +__PACKAGE__->meta->get_attribute('property1')->tableName, 'asset', 'tableName copied from attribute into property';
|
||||
::isa_ok +__PACKAGE__->getProperty('property1'), 'WebGUI::Definition::Meta::Property::Asset';
|
||||
|
||||
::can_ok +__PACKAGE__, 'update';
|
||||
::can_ok +__PACKAGE__, 'tableName';
|
||||
|
||||
::can_ok +__PACKAGE__->getProperty('property1'), 'tableName';
|
||||
::is +__PACKAGE__->getProperty('property1')->tableName, 'asset', 'tableName set on property to asset';
|
||||
|
||||
my $object = __PACKAGE__->new;
|
||||
$object->set({property1 => 'property value'});
|
||||
::is $object->property1, 'property value', 'checking set, hashref form';
|
||||
|
|
@ -172,10 +168,10 @@ use WebGUI::Test;
|
|||
|
||||
package main;
|
||||
|
||||
is +WGT::Class::AlsoAsset->getProperty('property1')->tableName, 'asset', 'tableName set in base class';
|
||||
is +WGT::Class::AlsoAsset->tableName, 'asset', 'tableName set in base class';
|
||||
|
||||
is +WGT::Class::Asset::Snippet->getProperty('property10')->tableName, 'snippet', 'tableName set in subclass';
|
||||
is +WGT::Class::Asset::Snippet->getProperty('property1')->tableName, 'asset', '... but inherited properties keep their tableName';
|
||||
is +WGT::Class::Asset::Snippet->meta->find_attribute_by_name('property10')->tableName, 'snippet', 'tableName set in subclass';
|
||||
is +WGT::Class::Asset::Snippet->meta->find_attribute_by_name('property1')->tableName, 'asset', '... but inherited properties keep their tableName';
|
||||
|
||||
cmp_bag(
|
||||
[ map {$_->name} WGT::Class::AlsoAsset->meta->get_attributes ],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue