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

(-)a/t/db_dependent/Circulation/Branch.t (+2 lines)
Lines 292-297 $query = Link Here
292
$dbh->do( $query, {}, $borrower_id1, $item_id1, $samplebranch1->{branchcode} );
292
$dbh->do( $query, {}, $borrower_id1, $item_id1, $samplebranch1->{branchcode} );
293
293
294
t::lib::Mocks::mock_preference( 'CataloguingLog', 1 );
294
t::lib::Mocks::mock_preference( 'CataloguingLog', 1 );
295
t::lib::Mocks::mock_userenv( { branchcode => $samplebranch2->{branchcode} } );
296
295
my $log_count_before = $schema->resultset('ActionLog')->search({module => 'CATALOGUING'})->count();
297
my $log_count_before = $schema->resultset('ActionLog')->search({module => 'CATALOGUING'})->count();
296
my ($doreturn, $messages, $iteminformation, $borrower) = AddReturn('barcode_1',
298
my ($doreturn, $messages, $iteminformation, $borrower) = AddReturn('barcode_1',
297
    $samplebranch2->{branchcode});
299
    $samplebranch2->{branchcode});
(-)a/t/db_dependent/Circulation/StoreLastBorrower.t (-2 / +5 lines)
Lines 38-47 subtest 'Test StoreLastBorrower' => sub { Link Here
38
38
39
    t::lib::Mocks::mock_preference( 'StoreLastBorrower', '1' );
39
    t::lib::Mocks::mock_preference( 'StoreLastBorrower', '1' );
40
40
41
    my $patron = $builder->build(
41
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
42
    my $patron  = $builder->build(
42
        {
43
        {
43
            source => 'Borrower',
44
            source => 'Borrower',
44
            value  => { privacy => 1, }
45
            value  => { privacy => 1, branchcode => $library->branchcode }
45
        }
46
        }
46
    );
47
    );
47
48
Lines 57-62 subtest 'Test StoreLastBorrower' => sub { Link Here
57
        }
58
        }
58
    );
59
    );
59
60
61
    t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } );
62
60
    $item = $item->get_from_storage;
63
    $item = $item->get_from_storage;
61
    my $patron_object = $item->last_returned_by();
64
    my $patron_object = $item->last_returned_by();
62
    is( $patron_object, undef, 'Koha::Item::last_returned_by returned undef' );
65
    is( $patron_object, undef, 'Koha::Item::last_returned_by returned undef' );
(-)a/t/db_dependent/Koha/Account/Line.t (-2 / +1 lines)
Lines 394-399 subtest 'apply() tests' => sub { Link Here
394
    is( $messages[0]->payload->{success}, 1, "'success' key in payload" );
394
    is( $messages[0]->payload->{success}, 1, "'success' key in payload" );
395
395
396
    t::lib::Mocks::mock_preference( 'MarkLostItemsAsReturned', 'onpayment');
396
    t::lib::Mocks::mock_preference( 'MarkLostItemsAsReturned', 'onpayment');
397
    t::lib::Mocks::mock_userenv( { branchcode => $library->id } );
397
    my $loser  = $builder->build_object( { class => 'Koha::Patrons' } );
398
    my $loser  = $builder->build_object( { class => 'Koha::Patrons' } );
398
    my $loser_account = $loser->account;
399
    my $loser_account = $loser->account;
399
400
Lines 443-450 subtest 'apply() tests' => sub { Link Here
443
444
444
    is( $loser->checkouts->next, undef, "Item has been returned");
445
    is( $loser->checkouts->next, undef, "Item has been returned");
445
446
446
447
448
    $schema->storage->txn_rollback;
447
    $schema->storage->txn_rollback;
449
};
448
};
450
449
(-)a/t/db_dependent/Koha/Checkouts.t (+2 lines)
Lines 165-170 subtest 'patron' => sub { Link Here
165
        }
165
        }
166
    )->store;
166
    )->store;
167
167
168
    t::lib::Mocks::mock_userenv( { branchcode => $library->{branchcode} } );
169
168
    my $p = $checkout->patron;
170
    my $p = $checkout->patron;
169
    is( ref($p), 'Koha::Patron',
171
    is( ref($p), 'Koha::Patron',
170
        'Koha::Checkout->patron should return a Koha::Patron' );
172
        'Koha::Checkout->patron should return a Koha::Patron' );
(-)a/t/db_dependent/Koha/SearchEngine/Indexer.t (-1 / +1 lines)
Lines 69-74 subtest 'Test indexer calls' => sub { Link Here
69
    skip 'Elasticsearch configuration not available', 20
69
    skip 'Elasticsearch configuration not available', 20
70
            if scalar @engines == 1;
70
            if scalar @engines == 1;
71
    }
71
    }
72
    t::lib::Mocks::mock_userenv();
72
73
73
    t::lib::Mocks::mock_preference( 'AutoLinkBiblios', 0 );
74
    t::lib::Mocks::mock_preference( 'AutoLinkBiblios', 0 );
74
75
75
- 

Return to bug 33641