Add more tests for the object instanciated by create. Still
needs a db interface, though.
This commit is contained in:
parent
3f4aed78d2
commit
cf5dfda32e
1 changed files with 18 additions and 6 deletions
|
|
@ -28,7 +28,7 @@ my $session = WebGUI::Test->session;
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Tests
|
# Tests
|
||||||
|
|
||||||
my $tests = 4;
|
my $tests = 9;
|
||||||
plan tests => 1 + $tests;
|
plan tests => 1 + $tests;
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -104,11 +104,23 @@ like ($@, qr/You must pass a hashref of options to create a new ShipDriver objec
|
||||||
eval { $driver = WebGUI::Shop::ShipDriver->create($session, {}); };
|
eval { $driver = WebGUI::Shop::ShipDriver->create($session, {}); };
|
||||||
like ($@, qr/You must pass a hashref of options to create a new ShipDriver object/, 'create croaks with an empty hashref of options');
|
like ($@, qr/You must pass a hashref of options to create a new ShipDriver object/, 'create croaks with an empty hashref of options');
|
||||||
|
|
||||||
#isa_ok($driver, 'WebGUI::Shop::ShipDriver');
|
$driver = WebGUI::Shop::ShipDriver->create(
|
||||||
#
|
$session,
|
||||||
#isa_ok($driver->session, 'WebGUI::Session', 'session method returns a session object');
|
{
|
||||||
#
|
label => 'Slow and dangerous',
|
||||||
#is($session->getId, $driver->session->getId, 'session method returns OUR session object');
|
enabled => 1,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
isa_ok($driver, 'WebGUI::Shop::ShipDriver');
|
||||||
|
|
||||||
|
isa_ok($driver->session, 'WebGUI::Session', 'session method returns a session object');
|
||||||
|
|
||||||
|
is($session->getId, $driver->session->getId, 'session method returns OUR session object');
|
||||||
|
|
||||||
|
like($driver->shipperId, $session->id->getValidator, 'got a valid GUID for shipperId');
|
||||||
|
|
||||||
|
is($driver->className, ref $driver, 'className property set correctly');
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue