View | Details | Raw Unified | Return to bug 33641
Collapse All | Expand All

(-)a/t/db_dependent/Circulation/MarkIssueReturned.t (-2 / +31 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 4;
20
use Test::More tests => 5;
21
use Test::Exception;
21
use Test::Exception;
22
22
23
use t::lib::Mocks;
23
use t::lib::Mocks;
Lines 304-306 subtest 'AutoRemoveOverduesRestrictions' => sub { Link Here
304
304
305
    $schema->storage->txn_rollback;
305
    $schema->storage->txn_rollback;
306
};
306
};
307
- 
307
308
subtest 'Pass return_branch to old_issues' => sub {
309
    plan tests => 2;
310
311
    $schema->storage->txn_begin;
312
313
    my $category = $builder->build_object( { class => 'Koha::Patron::Categories', value => { category_type => 'P', enrolmentfee => 0 } } );
314
    my $library  = $builder->build_object( { class => 'Koha::Libraries' } );
315
    my $patron   = $builder->build_object(
316
        {   class => 'Koha::Patrons',
317
            value => { branchcode => $library->branchcode, categorycode => $category->categorycode }
318
        }
319
    );
320
    my $item = $builder->build_sample_item(
321
        {
322
            library => $library->branchcode,
323
        }
324
    );
325
326
    t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } );
327
328
    my $issue = C4::Circulation::AddIssue( $patron, $item->barcode );
329
    my $issue_id = C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item->itemnumber );
330
331
    is( $issue_id, $issue->issue_id, 'Item has been returned' );
332
    my $old_issue = Koha::Old::Checkouts->find( $issue_id );
333
    is( $old_issue->return_branch, $library->branchcode, 'Return branch is passed correctly' );
334
335
    $schema->storage->txn_rollback
336
};

Return to bug 33641