Make get_property_list API compatible with get_attribute_list, by returning an array.
This commit is contained in:
parent
64fc4a231d
commit
5b5d4783d0
2 changed files with 7 additions and 7 deletions
|
|
@ -81,7 +81,7 @@ sub get_property_list {
|
||||||
$meta->get_attributes # All attributes
|
$meta->get_attributes # All attributes
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
return \@properties;
|
return @properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ my $called_getProperties;
|
||||||
|
|
||||||
|
|
||||||
::cmp_deeply(
|
::cmp_deeply(
|
||||||
+__PACKAGE__->getProperties,
|
[ +__PACKAGE__->getProperties ],
|
||||||
[qw/property1 property2/],
|
[qw/property1 property2/],
|
||||||
'getProperties works as a class method'
|
'getProperties works as a class method'
|
||||||
);
|
);
|
||||||
|
|
@ -81,13 +81,13 @@ my $called_getProperties;
|
||||||
::is $written, 1, 'update calls write';
|
::is $written, 1, 'update calls write';
|
||||||
|
|
||||||
::cmp_deeply(
|
::cmp_deeply(
|
||||||
$object->meta->get_property_list,
|
[ $object->meta->get_property_list ],
|
||||||
[qw/property2 property1/],
|
[qw/property2 property1/],
|
||||||
'->meta->get_property_list returns properties in insertion order'
|
'->meta->get_property_list returns properties as a list in insertion order'
|
||||||
);
|
);
|
||||||
|
|
||||||
::cmp_deeply(
|
::cmp_deeply(
|
||||||
$object->getProperties,
|
[$object->getProperties ],
|
||||||
[qw/property2 property1/],
|
[qw/property2 property1/],
|
||||||
'getProperties is an alias for ->meta->get_property_list'
|
'getProperties is an alias for ->meta->get_property_list'
|
||||||
);
|
);
|
||||||
|
|
@ -127,7 +127,7 @@ my $called_getProperties;
|
||||||
);
|
);
|
||||||
|
|
||||||
cmp_deeply(
|
cmp_deeply(
|
||||||
WGT::Class::Asset::Snippet->getProperties,
|
[ WGT::Class::Asset::Snippet->getProperties ],
|
||||||
[qw/property1 property2 property3 property10 property11/],
|
[qw/property1 property2 property3 property10 property11/],
|
||||||
'checking inheritance of properties by name, insertion order'
|
'checking inheritance of properties by name, insertion order'
|
||||||
);
|
);
|
||||||
|
|
@ -147,7 +147,7 @@ my $called_getProperties;
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
cmp_deeply(
|
cmp_deeply(
|
||||||
WGT::Class::Asset::NotherOne->getProperties,
|
[WGT::Class::Asset::NotherOne->getProperties],
|
||||||
[qw/property1 property2 property3 property10/],
|
[qw/property1 property2 property3 property10/],
|
||||||
'checking inheritance of properties by name, insertion order with an overridden property'
|
'checking inheritance of properties by name, insertion order with an overridden property'
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue