]> git.koha-community.org Git - koha.git/commit
Bug 21230: Prevent Reserves.t to fail randomly
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 15 Aug 2018 15:21:38 +0000 (12:21 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 21 Sep 2018 13:03:37 +0000 (15:03 +0200)
commit2aeacaa96ee71cbd77fdfd372206ead7bce0c589
treecd8b756b539a2c89b0fa50fd564757771b6937c0
parent70284a33e41c1b9c86b5454e49c44e276c2d2e7d
Bug 21230: Prevent Reserves.t to fail randomly

The following test can fail if the hold has been generated with found => 'W':
 #   Failed test 'No tests run for subtest "_koha_notify_reserve() tests"'
 #   at t/db_dependent/Reserves.t line 675.
Can't call method "to_address" on an undefined value at
t/db_dependent/Reserves.t line 661.
 # Looks like your test exited with 255 just after 56.

We should call AddReserve instead.

Test plan:
0. Do not apply this patch
1. Do the following change:
    my $hold = $builder->build({
            source => 'Reserve',
            value => {
               borrowernumber=>$hold_borrower,
               found => 'W', # This line is added, do not forget the comma above
            }
        });
2. Prove it makes the test fail
3. stash the changes and apply this patch
4. Make sure the tests pass

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c957b52ef8bba734043157445470bedc36feae5e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c359d56f25a0b346b71a3fd8700b07e4713640d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
t/db_dependent/Reserves.t