Lines 1692-1698
subtest 'BorrowersLog tests' => sub {
Link Here
|
1692 |
$schema->storage->txn_rollback; |
1692 |
$schema->storage->txn_rollback; |
1693 |
|
1693 |
|
1694 |
subtest 'Test Koha::Patrons::merge' => sub { |
1694 |
subtest 'Test Koha::Patrons::merge' => sub { |
1695 |
plan tests => 110; |
1695 |
plan tests => 111; |
1696 |
|
1696 |
|
1697 |
my $schema = Koha::Database->new()->schema(); |
1697 |
my $schema = Koha::Database->new()->schema(); |
1698 |
|
1698 |
|
Lines 1704-1709
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
1704 |
my $loser_1 = $builder->build({ source => 'Borrower' })->{borrowernumber}; |
1704 |
my $loser_1 = $builder->build({ source => 'Borrower' })->{borrowernumber}; |
1705 |
my $loser_2 = $builder->build({ source => 'Borrower' })->{borrowernumber}; |
1705 |
my $loser_2 = $builder->build({ source => 'Borrower' })->{borrowernumber}; |
1706 |
|
1706 |
|
|
|
1707 |
my $anonymous_patron_orig = C4::Context->preference('AnonymousPatron'); |
1708 |
my $anonymous_patron = $builder->build({ source => 'Borrower' })->{borrowernumber}; |
1709 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous_patron ); |
1710 |
|
1707 |
while (my ($r, $field) = each(%$resultsets)) { |
1711 |
while (my ($r, $field) = each(%$resultsets)) { |
1708 |
$builder->build({ source => $r, value => { $field => $keeper->id } }); |
1712 |
$builder->build({ source => $r, value => { $field => $keeper->id } }); |
1709 |
$builder->build({ source => $r, value => { $field => $loser_1 } }); |
1713 |
$builder->build({ source => $r, value => { $field => $loser_1 } }); |
Lines 1732-1738
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
1732 |
|
1736 |
|
1733 |
is( Koha::Patrons->find($loser_1), undef, 'Loser 1 has been deleted' ); |
1737 |
is( Koha::Patrons->find($loser_1), undef, 'Loser 1 has been deleted' ); |
1734 |
is( Koha::Patrons->find($loser_2), undef, 'Loser 2 has been deleted' ); |
1738 |
is( Koha::Patrons->find($loser_2), undef, 'Loser 2 has been deleted' ); |
|
|
1739 |
is( ref Koha::Patrons->find($anonymous_patron), 'Koha::Patron', 'Anonymous Patron was not deleted' ); |
1735 |
|
1740 |
|
|
|
1741 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', '' ); |
1736 |
$schema->storage->txn_rollback; |
1742 |
$schema->storage->txn_rollback; |
1737 |
}; |
1743 |
}; |
1738 |
|
1744 |
|
1739 |
- |
|
|