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

(-)a/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm (+2 lines)
Lines 129-134 Enqueue the new job Link Here
129
sub enqueue {
129
sub enqueue {
130
    my ( $self, $args ) = @_;
130
    my ( $self, $args ) = @_;
131
131
132
    return if !C4::Context->preference('RealTimeHoldsQueue');    #TODO Remove check from callers
133
132
    Koha::Exceptions::MissingParameter->throw(
134
    Koha::Exceptions::MissingParameter->throw(
133
        "Missing biblio_ids parameter is mandatory")
135
        "Missing biblio_ids parameter is mandatory")
134
      unless exists $args->{biblio_ids};
136
      unless exists $args->{biblio_ids};
(-)a/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t (-2 / +8 lines)
Lines 32-43 my $builder = t::lib::TestBuilder->new; Link Here
32
32
33
subtest 'enqueue() tests' => sub {
33
subtest 'enqueue() tests' => sub {
34
34
35
    plan tests => 5;
35
    plan tests => 6;
36
36
37
    $schema->storage->txn_begin;
37
    $schema->storage->txn_begin;
38
38
39
    my $biblio_ids = [ 1, 2 ];
39
    my $biblio_ids = [ 1, 2 ];
40
40
41
    t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 );
42
    is(
43
        Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => $biblio_ids } ),
44
        undef, 'No result when pref is off'
45
    );
46
    t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 1 );
47
41
    throws_ok
48
    throws_ok
42
        { Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue() }
49
        { Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue() }
43
        'Koha::Exceptions::MissingParameter',
50
        'Koha::Exceptions::MissingParameter',
44
- 

Return to bug 35979