Commit Graph

3857 Commits

Author SHA1 Message Date
Tomas Cohen Arazi 525ca46cc7 Bug 25623: Make sure oauth.t rolls back the db
This patch adds a missing transaction wrapping one of the subtests. This
is probably an oversight when refactoring this file.

To test:
1. Open the patron categories page
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/oauth.t
=> SUCCESS: Tests pass
3. Reload the patron categories page
=> FAIL: There's random data in there
4. Apply this patch and repeat 2
5. Reload the patron categories page
=> SUCCESS: The random data from the previous tests is still there, but
no new random data
=> SUCCESS: Tests still pass
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f898cef4f4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0734017ab6)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit 4c536ffbce)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-07-03 01:35:39 +02:00
Tomas Cohen Arazi 9484adb366 Bug 24862: Regression tests
This patch introduces tests for the expected behaviour on API routes
that expect a logged in user, but the request is made with an anonymous
session cookie.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail because the situation is not handled correctly in
the code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0547ad34df)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit 8d2255bddc)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-30 21:19:07 +02:00
Jonathan Druart b292eaa80e Bug 23825: table name is not always displayed
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

(cherry picked from commit 0498ffb633)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-23 01:13:20 +02:00
Marcel de Rooy 56d98b914d Bug 23825: (QA follow-up) Remove database name
As requested on comment15.

Test plan:
Run t/db_dependent/Koha/Object.t again

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

(cherry picked from commit e5cdf88544)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-23 01:13:12 +02:00
Jonathan Druart bf5273a52d Bug 23825: Add tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT]
Changed 'is' to 'like' with regex since we also have the db name.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

(cherry picked from commit 6a2c5d665e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-23 01:13:07 +02:00
Jonathan Druart be50a62d33 Bug 25538: Don't run search_utf8.t if KOHA_*_URL empty
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c4d244405)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d1f60037b9)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit 27831fe442)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-18 00:13:36 +02:00
Nick Clemens 5f2885cd98 Bug 25617: (QA follow-up) Add responses to tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 46e23b3a03)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit db19a00854)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-17 21:55:31 +02:00
Jonathan Druart eff38d4271 Bug 25617: (bug 25133 follow-up) 12 PM is not 24 but 0
There was an error in the precedent code, in 12hr format, 12PM is
actually 00:00

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dd0c7c55fc)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit 04791a15ca)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-17 21:55:09 +02:00
Jonathan Druart 8767c55242 Bug 24413: Add tests
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit bbe6b07f43)
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit ec82606a3a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-12 21:16:53 +02:00
Jonathan Druart 120fdbb8f3 Bug 25531: Add tests
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>

(cherry picked from commit 6066bb39a5)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-11 18:06:29 +02:00
Jonathan Druart 20c7973836 Bug 24062: Make sure TestBuilder will stop generate X or other invalid category's types
To make sure this kind of random failures will not appear in a future we
are going to fix it at TestBuilder level.

Test plan:
  prove t/db_dependent/TestBuilder.t
and confirm it returns green

You could also only apply the tests against master, run them several
times and confirm that they fail most of the time.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

(cherry picked from commit fda209ca50)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-11 18:06:24 +02:00
Jonathan Druart 793b9dd0b2 Bug 24062: Fix the failing test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

(cherry picked from commit cbe22553fe)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-11 18:06:14 +02:00
Jonathan Druart bae4bd3d0d Bug 24881: [19.05.x] Try to fix random failure from Circulation.t
This is a follow-up of bug 22917.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>

(cherry picked from commit b0551cfd17)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-11 18:06:09 +02:00
Tomas Cohen Arazi ba884d407a Bug 24458: Regression tests
This patch introduces tests for searchResults. The idea is to set a
subfield as hidden in OPAC and another on the staff interface, and see
if searchResults honours this on the XSLTResultsRecord contents.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Search.t
=> FAIL: This is not really implemented

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>

(cherry picked from commit 448915cc3d)
2020-06-09 18:48:20 +02:00
Jonathan Druart 5ed94d4c8f Bug 23994: Fix random failure from AdditionalFields.t (U18)
t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t .. 1/12
 #   Failed test '->additional_field_values should return the correct values'
 #   at t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t line 82.
 #     Structures begin differing at:
 #          $got->[0]{value} = 'bar value for basket2'
 #     $expected->[0]{value} = 'foo value for basket2'
 # Looks like you failed 1 test of 12.

We do not really know why, but the values are not returned in the order they
are stored in DB. Fixing this random failure for now at test level.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

(cherry picked from commit 6f464191ff)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-06-08 16:40:08 +02:00
Marcel de Rooy b5807429f7 Bug 22437: Add test case to Merge.t
Test proves now that a 'destructive merge' is removed by
DelAuthority.

Test plan:
Run t/db_dependent/Authority/Merge.t. Should fail when you
do not apply the other two patches and pass with them.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c748b95d57)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-15 22:32:22 +00:00
Nick Clemens 6d4934ed28 Bug 25342: Unit test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 5518f91830)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-15 22:26:42 +00:00
Joy Nelson 68746bb517 Bug 25184: (follow-up) fix number of tests
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 75e7861df4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-15 22:04:44 +00:00
Kyle M Hall 0b5c428eed Bug 25184: Add syspref
It's entirely possible that some libraries are relying on the current
before for part of their workflow. Do to this possibility, it seems like
a good idea to control this behavior via a system preference.

Test Plan:
1) Apply this patch set
2) Run updatedatabase.pl
3) Set TrapHoldsOnOrder to "don't trap"
4) Set an item's notforloan value to -1
5) Place a hold on that item
6) Check in the item
7) Note the item is not trapped for hold
9) Set TrapHoldsOnOrder to "trap"
10) Check in the item
11) Koha should now ask if you'd like to trap the item for the hold!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit bb3893720d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-15 21:54:31 +00:00
Kyle M Hall 19953fc687 Bug 25184: Items with a negative notforloan status should not be captured for holds
Negative notforloan statuses should allow holds to be placed but not captured.

Due to coronavirus, we have libraries setting all returned materials to a negative notforloan value of Quarantine for several days.
They're using UpdateNotForLoanStatusOnCheckin to set that status automatically. However, those items are still capturing for holds,
even though those items cannot be checked out until the notforloan status is removed.

In cases like an On Order item where we do want the hold to fill at checkin,
UpdateNotForLoanStatusOnCheckin should be used to clear that notforloan status so the hold can fill.

In master, if I set an item to a not for loan but holdable status ( < 0 ) I can place the hold,
capture the hold and set it to waiting, but *not* check it out to the patron!
This does not make sense. I should not be able to trap an item for checkout unless it can be checked out.

Test Plan:
1) Set an item's notforloan value to -1
2) Place a hold on that item
3) Check in the item
4) Trap the item for that hold
5) Attempt to check the item out to the patron, you will be unable to
   because it is notforloan
6) Apply this patch
7) Restart all the things!
8) Repeat steps 1-3
9) The screen should no longer ask if the item should be trapped
   to fill the hold!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Catherine Ingram <Catherine.Ingram@cedarparktexas.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit aa9a4fc3f6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-15 21:54:14 +00:00
Jonathan Druart 7ba8d1752a Bug 25133: Handle 12hr format for dt_from_string
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 1adb28bc23)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-15 19:50:19 +00:00
Jonathan Druart 3f4f576ba0 Bug 22828: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit b5add0dd05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-15 15:34:37 +00:00
Jonathan Druart 198c7067bd Bug 23081: Adjust tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 31dd98d6d4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-14 21:43:30 +00:00
Tomas Cohen Arazi 427f564c4d Bug 25008: Tests for ->options
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit b2b36b6f44)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-13 22:02:55 +00:00
Tomas Cohen Arazi da64d7ceb9 Bug 25008: Regression tests
This patch highlights a behaviour of Koha::RecordProcessor that is
unexpected: if you change the original options using ->options, the
loaded filters don't pick the change. That's because the filter objects
are loaded on ->new, and they are never updated.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/RecordProcessor.t
=> FAIL: Test prove ->options doesn't update the filters!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 008b09ce05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-13 22:01:55 +00:00
Marcel de Rooy 2f48fb0d38 Bug 24903: Add tests for _handle_seqno
Trivial tests.

Test plan:
Run t/Serials/ModSerialStatus.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 71eb787fbd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-13 21:44:39 +00:00
Kyle M Hall 11b8184338 Bug 24966: Add unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 93d95ac1b3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-13 21:33:36 +00:00
Kyle M Hall 76b470f035 Bug 22778: Add unit test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0c64138dd1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-13 21:06:15 +00:00
Jonathan Druart 8c2788855a Bug 25046: Add test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit e370007f0e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-11 22:01:25 +00:00
Jonathan Druart 188bab98c8 Bug 24964: [19.11.x] Prevent random failures sorting by borrowernumber
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 6c962a7d5a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-11 20:59:45 +00:00
Jonathan Druart da20e30b9c Bug 24964: [19.11.x] Add tests
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit b3d97ce029)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-05-11 20:59:05 +00:00
Jonathan Druart ac5c82b6a2 Bug 24013: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-30 15:55:34 +00:00
Jonathan Druart 98178e0bb8 Bug 24614: Fix Reports/Guided.t
DBD::mysql::st execute failed: Column 'public' cannot be null [for Statement "UPDATE `saved_sql` SET `last_modified` = ?, `notes` = ?, `public` = ?, `report_group` = ?, `report_name` = ?, `report_subgroup` = ?,
`savedsql` = ? WHERE ( `id` = ? )" with ParamValues: 0='2020-03-27T16:03:04', 1=undef, 2=undef, 3=undef, 4='Just another report', 5=undef, 6=undef, 7=25] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836.
    # Looks like you planned 17 tests but ran 6.

update_sql expect all the paramters to be set, otherwise it will be
nulled.

The best way to fix it is at test level. There is only 1 occurrence in
controller/module, and it sends all the parameters. That is the correct
way to do and will make things easier when we will removed them to use
Koha::Reports directly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 60c88bfa2f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-13 20:39:47 +00:00
Jonathan Druart b3fa716084 Bug 24614: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit d3d27f48d8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-13 20:39:09 +00:00
Marcel de Rooy 198484d3b9 Bug 21708: Add a few tests in TransformHtmlToMarc.t
Test plan:
Run t/db_dependent/Biblio/TransformHtmlToMarc.t without the module change
patch. Verify that the test fails on the order of fields.
Go to test plan of the second patch.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit ca2ebddb13)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-13 20:10:32 +00:00
Jonathan Druart 707f7e6bbc Bug 23900: Add tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit ca4f14180b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-13 19:17:41 +00:00
Marcel de Rooy 5418efe482 Bug 24756: [19.11.X] Catch two failed to load-variations in Security.t
Test 7 in Security.t failed when 'failed to load HTTP resource' was
returned by libxml2 instead of 'failed to load external entity'.

We now remove the debugging with Dumper again and adjust the regex to
include both variations.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 09b8c38a82)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-13 16:59:22 +00:00
Jonathan Druart 22e48c05e2 Bug 24200: (follow-up) Try to fix random failures from Borrower_PrevCheckout.t
2 other occurrences where missing.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit d4db0b96e8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-13 16:32:42 +00:00
Jonathan Druart 0acd6c823a Bug 24200: Try to fix random failures from Borrower_PrevCheckout.t
It failed inconsistently, let's try to use build_sample_item and see if
it fixes the random failures.

Test plan:
 % prove t/db_dependent/Patron/Borrower_PrevCheckout.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit d5e9dc31ca)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-13 16:31:37 +00:00
Katrin Fischer b3843211de Bug 22943: Remove unused line from Auth.t
Removes an unnecessary variable declaration from Auth.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 04359d9bbb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-10 16:37:14 +00:00
Hayley Mapley e4eb3a7041 Bug 22943: Renames the in_ipset function to in_iprange in C4::Auth
Bug 14407 introduced a new system preference to allow limiting the
online self checkout system to an IP or IP Range. The function that
handles this is called in_ipset, which is the name of a linux tool. To
stop confusion, this patch renames the function to 'in_iprange', and the
variable 'ipset' within it to 'iprange'.

To test, follow the test plans outlined in Bug 14407 and confirm that
everything works as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 46b219864e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-10 16:36:43 +00:00
Marcel de Rooy 8e1b95951f Bug 24760: (follow-up) Add a neighboring test messsage
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 390f838d27)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-09 20:43:52 +00:00
Julian Maurice 3f556c4569 Bug 24760: Use C4::BackgroundJob->fetch in tests
Starting with YAML 1.30 and YAML::Syck 1.32, these modules don't bless
loaded objects by default. This is not a problem as
C4::BackgroundJob->fetch bless them anyway.

So, instead of testing what's in the session, test the result of
C4::BackgroundJob->fetch, which is what's used everywhere else

Test plan:
1. Install latest version of YAML::Syck (or YAML if YAML::Syck is not
installed)
2. prove t/db_dependent/BackgroundJob.t => should FAIL
3. Apply patch
4. prove t/db_dependent/BackgroundJob.t => should PASS
5. Verify that background jobs are still working (for instance,
tools/batchMod.pl)

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c1c3cfed5c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-09 20:43:38 +00:00
Jonathan Druart 1993e98edf Bug 24813: Prevent api/v1/holds.t to fail randomly
Hold cannot be suspended if found=W:
Koha::Hold->suspend_hold
 90     if ( $self->is_found ) {    # We can't suspend found holds

So when TestBuilder generate a hold with found=W the test fail.

A question however:
Why did not we have the correct exception displayed somewhere? That
would be much more helpful to find the problem!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c405b03dd3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-09 20:15:37 +00:00
Marcel de Rooy a71ceb222d Bug 24294: (QA follow-up) Add rollback and 008 default test
Default for 008 was not tested yet.
Only wondering if we should insert default values only when we meet an
undefined value. Or should we also add if we meet an empty string? Is the
latter not more realistic in MARC?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 9056d53e32)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-08 15:36:18 +00:00
Jonathan Druart 98e48a892c Bug 24294: Add default value support for control fields in ACQ framework
When trying to add an order using the ACQ framework with a 008@ tag,
Koha explodes:

Control fields (generally, just tags below 010) do not have subfields,
use data() at /home/vagrant/kohaclone/C4/Acquisition.pm line 3272.

Test plan:
Set a default value for a control field in the ACQ framework
Turn on UseACQFrameworkForBiblioRecords
Create a new order from a new record
The default value should be displayed
Save
=> No crash

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit dec127df2a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-08 15:35:53 +00:00
Marcel de Rooy d0623804eb Bug 24114: (follow-up) Resolve warning on non-numeric subtraction
Argument "" isn't numeric in subtraction (-) at /usr/share/koha/Koha/Patrons.pm line 290.

Coming from an empty or undefined FailedLoginAttempts.

Test plan:
Verify that Koha/Patrons.t still passes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c242f86677)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-04-08 15:00:38 +00:00
Nick Clemens ce0dd60b61 Bug 24094: Unit tests
Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 8288f02c37)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-03-18 21:54:26 +00:00
Jonathan Druart 51c01cb843 Bug 24494: Make the regex more exact
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 3c45a6ac63)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-03-18 21:49:07 +00:00
Victor Grousset/tuxayo 43798cc1f4 Bug 24494: tests: 00-valid-xml.t shouldn't check node_modules
== Test plan ==
- work with SCSS (just recompile it if you never did)
  - https://wiki.koha-community.org/wiki/Working_with_staff_client_SCSS
- now you have a node_modules directory
- prove -r t/00-valid-xml.t
- it should fail on files in node_modules
- apply this patch
- prove -r t/00-valid-xml.t
- it should work
- sabotage a legitimate XML file, like etc/SIPconfig.xml
- prove -r t/00-valid-xml.t
- it should fail, good the test is still useful
- undo the sabotage

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 088a610682)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-03-18 21:47:56 +00:00