|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 11; |
20 |
use Test::More tests => 12; |
| 21 |
use Test::Exception; |
21 |
use Test::Exception; |
| 22 |
use Test::Warn; |
22 |
use Test::Warn; |
| 23 |
use DateTime; |
23 |
use DateTime; |
|
Lines 415-417
subtest 'unblessed_all_relateds' => sub {
Link Here
|
| 415 |
|
415 |
|
| 416 |
$schema->storage->txn_rollback; |
416 |
$schema->storage->txn_rollback; |
| 417 |
}; |
417 |
}; |
| 418 |
- |
418 |
|
|
|
419 |
subtest 'new_from_hashref' => sub { |
| 420 |
plan tests => 1; |
| 421 |
|
| 422 |
$schema->storage->txn_begin; |
| 423 |
|
| 424 |
my $categorycode = $builder->build({ source => 'Category' })->{categorycode}; |
| 425 |
my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; |
| 426 |
|
| 427 |
my $patron1 = Koha::Patron->new({categorycode => $categorycode, branchcode => $branchcode })->store; |
| 428 |
|
| 429 |
my $hashref = $patron1->unblessed; |
| 430 |
|
| 431 |
my $patron2 = Koha::Patron->_new_from_hashref( $hashref ); |
| 432 |
|
| 433 |
is( $patron1->id, $patron2->id, "Borrowernumbers match using new_from_hashref"); |
| 434 |
|
| 435 |
$schema->storage->txn_rollback; |
| 436 |
}; |