Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 19; |
20 |
use Test::More tests => 20; |
21 |
use Test::Exception; |
21 |
use Test::Exception; |
22 |
use Test::Warn; |
22 |
use Test::Warn; |
23 |
use DateTime; |
23 |
use DateTime; |
Lines 818-820
subtest 'prefetch_whitelist() tests' => sub {
Link Here
|
818 |
|
818 |
|
819 |
$schema->storage->txn_rollback; |
819 |
$schema->storage->txn_rollback; |
820 |
}; |
820 |
}; |
821 |
- |
821 |
|
|
|
822 |
subtest 'new_from_hashref' => sub { |
823 |
plan tests => 1; |
824 |
|
825 |
$schema->storage->txn_begin; |
826 |
|
827 |
my $categorycode = $builder->build({ source => 'Category' })->{categorycode}; |
828 |
my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; |
829 |
|
830 |
my $patron1 = Koha::Patron->new({categorycode => $categorycode, branchcode => $branchcode })->store; |
831 |
|
832 |
my $hashref = $patron1->unblessed; |
833 |
|
834 |
my $patron2 = Koha::Patron->_new_from_hashref( $hashref ); |
835 |
|
836 |
is( $patron1->id, $patron2->id, "Borrowernumbers match using new_from_hashref"); |
837 |
|
838 |
$schema->storage->txn_rollback; |
839 |
}; |