|
Lines 2112-2118
subtest 'BorrowersLog and CardnumberLog tests' => sub {
Link Here
|
| 2112 |
$schema->storage->txn_rollback; |
2112 |
$schema->storage->txn_rollback; |
| 2113 |
|
2113 |
|
| 2114 |
subtest 'Test Koha::Patrons::merge' => sub { |
2114 |
subtest 'Test Koha::Patrons::merge' => sub { |
| 2115 |
plan tests => 113; |
2115 |
plan tests => 118; |
| 2116 |
|
2116 |
|
| 2117 |
my $schema = Koha::Database->new()->schema(); |
2117 |
my $schema = Koha::Database->new()->schema(); |
| 2118 |
|
2118 |
|
|
Lines 2300-2305
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
| 2300 |
|
2300 |
|
| 2301 |
}; |
2301 |
}; |
| 2302 |
|
2302 |
|
|
|
2303 |
subtest 'ILL requests' => sub { |
| 2304 |
plan tests => 3; |
| 2305 |
|
| 2306 |
my $keep_patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 2307 |
my $merge_patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 2308 |
my $ill_request = $builder->build_sample_ill_request( { borrowernumber => $merge_patron->borrowernumber } ); |
| 2309 |
|
| 2310 |
is( $merge_patron->ill_requests->count, 1, 'Patron to be merged has 1 ILL request' ); |
| 2311 |
is( $keep_patron->ill_requests->count, 0, 'Patron to be kept has 0 ILL requests' ); |
| 2312 |
|
| 2313 |
$keep_patron->merge_with( [ $merge_patron->borrowernumber ] ); |
| 2314 |
is( $keep_patron->ill_requests->count, 1, 'Patron to be kept now has 1 ILL request' ); |
| 2315 |
}; |
| 2316 |
|
| 2303 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', '' ); |
2317 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', '' ); |
| 2304 |
$schema->storage->txn_rollback; |
2318 |
$schema->storage->txn_rollback; |
| 2305 |
}; |
2319 |
}; |
| 2306 |
- |
|
|