|
Lines 345-351
subtest 'Return same values as DBIx::Class' => sub {
Link Here
|
| 345 |
|
345 |
|
| 346 |
subtest 'Koha::Object->delete' => sub { |
346 |
subtest 'Koha::Object->delete' => sub { |
| 347 |
|
347 |
|
| 348 |
plan tests => 4; |
348 |
plan tests => 5; |
| 349 |
|
349 |
|
| 350 |
my ( $r_us, $e_us, $r_them, $e_them ); |
350 |
my ( $r_us, $e_us, $r_them, $e_them ); |
| 351 |
|
351 |
|
|
Lines 358-363
subtest 'Return same values as DBIx::Class' => sub {
Link Here
|
| 358 |
'Successful delete should return the object ' ); |
358 |
'Successful delete should return the object ' ); |
| 359 |
ok( !defined $e_us && !defined $e_them, |
359 |
ok( !defined $e_us && !defined $e_them, |
| 360 |
'Successful delete should not raise an exception' ); |
360 |
'Successful delete should not raise an exception' ); |
|
|
361 |
is( ref($r_us), 'Koha::City', 'Successful delete should return our Koha::Obect based object' ); |
| 361 |
|
362 |
|
| 362 |
# CASE 2 - Delete an object that is not in storage |
363 |
# CASE 2 - Delete an object that is not in storage |
| 363 |
try { $r_us = $r_us->delete; } catch { $e_us = $_ }; |
364 |
try { $r_us = $r_us->delete; } catch { $e_us = $_ }; |
|
Lines 463-469
subtest 'Return same values as DBIx::Class' => sub {
Link Here
|
| 463 |
|
464 |
|
| 464 |
subtest 'Koha::Object->delete' => sub { |
465 |
subtest 'Koha::Object->delete' => sub { |
| 465 |
|
466 |
|
| 466 |
plan tests => 6; |
467 |
plan tests => 7; |
| 467 |
|
468 |
|
| 468 |
my ( $r_us, $e_us, $r_them, $e_them ); |
469 |
my ( $r_us, $e_us, $r_them, $e_them ); |
| 469 |
|
470 |
|
|
Lines 480-485
subtest 'Return same values as DBIx::Class' => sub {
Link Here
|
| 480 |
'Successful delete should return the patron object' ); |
481 |
'Successful delete should return the patron object' ); |
| 481 |
ok( !defined $e_us && !defined $e_them, |
482 |
ok( !defined $e_us && !defined $e_them, |
| 482 |
'Successful delete should not raise an exception' ); |
483 |
'Successful delete should not raise an exception' ); |
|
|
484 |
is( ref($r_us), 'Koha::Patron', |
| 485 |
'Successful delete should return our Koha::Obect based object' ); |
| 483 |
|
486 |
|
| 484 |
# CASE 2 - Delete a patron that is not in storage |
487 |
# CASE 2 - Delete a patron that is not in storage |
| 485 |
try { $r_us = $r_us->delete; } catch { $e_us = $_ }; |
488 |
try { $r_us = $r_us->delete; } catch { $e_us = $_ }; |
| 486 |
- |
|
|