Add a few more tests, and some POD to make sure that
new is known to be different from create as an instanciator versus a constructor.
This commit is contained in:
parent
4b17be6e54
commit
0774bf771c
2 changed files with 24 additions and 2 deletions
|
|
@ -119,7 +119,7 @@ sub getId {
|
|||
|
||||
=head2 new ( addressBook, addressId )
|
||||
|
||||
Constructor. Instanciates an address based upon addressId.
|
||||
Constructor. Instanciates an existing address from the database based upon addressId.
|
||||
|
||||
=head3 addressBook
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ my $session = WebGUI::Test->session;
|
|||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
my $tests = 8;
|
||||
my $tests = 10;
|
||||
plan tests => 1 + $tests;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -98,12 +98,34 @@ cmp_deeply(
|
|||
$address = WebGUI::Shop::Address->create($book, {});
|
||||
isa_ok($address, 'WebGUI::Shop::Address', 'create returns an Address object with an empty hashref');
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# addressBook
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
cmp_deeply(
|
||||
$address->addressBook,
|
||||
$book,
|
||||
'The address has a reference back to the book used to create it'
|
||||
);
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# getId
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
ok( $session->id->valid($address->getId), 'Address has a valid GUID');
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# get
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
ok( $session->id->valid($address->getId), 'Address has a valid GUID');
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# new
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue