Commit Graph

5726 Commits

Author SHA1 Message Date
Martin Renvoize e710ed7f0b Bug 30524: Unit tests
Test plan:
Run t/Output.t
Run t/db_dependent/Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-07-27 04:51:11 +00:00
Jonathan Druart 3e595bcec0
Bug 29486: Fix tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-12 12:35:59 -03:00
Katrin Fischer 03fa06bdcb
Bug 29311: (follow-up) Fix t/db_dependent/selenium/regressions.t
The test was checking for the value of an input field.
But with this patch set, there is no longer an input, but
a link element with the title. This adjusts the patch to look
for the correct element.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 307df8f1af)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
(cherry picked from commit babebab0cb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6a5b7e974c)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-05-23 20:43:30 +02:00
Tomas Cohen Arazi f5570ef483 Bug 33100: (QA follow-up) Trivial QA fixes
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 057e6c2bc8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 656969e79a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 92a17f03a4)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-05-03 20:32:35 +02:00
Nick Clemens 2ebb59e42f Bug 33100: Unit test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7490453663)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 39d6ee4399)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8d08cd6122)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-05-03 20:32:35 +02:00
Nick Clemens c0435b9056
Bug 33211: Fix failing test
This patch updates the selector to use the full class and find the text
type as well

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 587615fd9f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 730f4e1500)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f702d225e3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-04-20 11:11:48 +02:00
Nick Clemens a0aa2ff4af
Bug 31471: Send multiple ISBN with 'OR' for FindDuplicate
When a record has multiple ISBNs the database stores them seperated by a
pipe

Zebra interprets a string like "isbn:1600213510 | 9781600213519" as an 'OR' search, but for
Elasticsearch we need to explicitly send "OR" - and Zebra support this
as well

To test:
1 - Make sure you are using Elasticsearch
2 - Cataloging->Add a new record from Z3950
3 - Choose target: LOC
4 - Search for: Control number: 14455023
5 - Import and save
6 - Search for the record again
7 - Import and save - duplicate check isn't been triggered
8 - Apply patch
9 - restart_all
10 - repeat 2-7
11 - this time you should get a duplicate notification
12 - Sitch SearchEngine syspref to 'Zebra'
13 - repeat 2-7
14 - Ensure you still get duplicate notification

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2dafd6f749)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 47ad3dd1b2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 26d9092de4)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-03-29 14:53:57 +02:00
Nick Clemens c917ed4e14
Bug 33055: (bug 32624 follow-up) Unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0324aed470)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 06194137ec)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1bf178a77e)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-03-29 14:53:57 +02:00
Jonathan Druart 3e127df848
Bug 33032: Remove alternateholdings_count
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e36e393c7d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 48bc9e54d8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8172a2ac14)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-03-29 14:53:56 +02:00
Jonathan Druart 0621872171
Bug 32926: Fix selenium tests
We should not rely on existing data, and we should remove data at the end.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f16baef879)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 99f7e5efb3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 22e6d24598)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-03-29 14:49:09 +02:00
Andreas Roussos 7999098f2f
Bug 32926: Add Selenium tests
This adds a new Selenium test to automatically test the correct
behaviour when expanding/collapsing System preferences sections
after a System preferences search.

Test plan:

1) Apply the other patch from this bug report, then run the
   new Selenium unit test which should pass without failures:

   prove -v t/db_dependent/selenium/system_preferences_search.t

Signed-off-by: Fridolin <fridolin.somers@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 14d65264af)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 1c1d52b61a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3681c92879)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-03-29 14:49:09 +02:00
Danyon Sewell b72c429a31
Bug 32375: Move t/AuthoritiesMarc_MARC21.t to t/db_dependent
t/AuthoritiesMarc_MARC21.t is now database dependent so it
needs to be in t/db_dependent to pass the tests.

Test plan (using koha-testing-docker):
1. If you run prove t/AuthoritiesMarc_MARC21.t without stopping
   the database, the tests will pass. To get the tests to fail:
   1.1 Stop the database - from a new terminal window run:
       docker stop koha-db-1
   1.2 In your Koha container run: prove t/AuthoritiesMarc_MARC21.t
       ==> The tests fail 8-(
2. Restart the database container from the terminal window you
   stopped it in: docker start koha-db-1
3. Apply the patch in the Koha container as normal.
4. Run: prove t/db_dependent/AuthoritiesMarc_MARC21.t
   ==> The test pass!
5. Sign off D:

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0688e18e62)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-03-29 14:19:02 +02:00
Kyle M Hall 4d457280df
Bug 32979: Skip test if running as root
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7a8a2d7110)
(cherry picked from commit 94f01de8ab)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1c4e423416)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-03-29 11:12:26 +02:00
Marcel de Rooy 8bbba0bfaa
Bug 32979: Add Test::Exception to Logger.t
Test plan:
Run t/Logger.t
Note: Run under koha user, not root. Root wont have
the permission failure which is tested.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2cdc018c81)
(cherry picked from commit 1575f81c8b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 06cbe54392)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-03-29 11:12:25 +02:00
Jonathan Druart 97b4bb06f0 Bug 32539: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7bb4aeba9f)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 24363f91da)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b5621e9313)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-02-17 14:10:14 +01:00
Nick Clemens 57f2cb78fa Bug 32624: Don't include guarantee or guarantor fines in BV (fines amount) in SIP messages
This patch chanegs the code to report only the patron's personal fines, and to report a block
from other fines in the screen message

This is to prevent overpayment on accounts from SIP machines

To test:
1 - prove t/db_dependent/SIP/Patron.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c6c2fe81a2)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit dd2fedd2a1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9b0656a62c)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-02-17 13:39:17 +01:00
Nick Clemens e10bf81548 Bug 29755: (follow-up) Mock NoIssuesChargeGuarantorsWithGuarantees in test
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 874afc0e53)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-02-17 13:38:27 +01:00
Nick Clemens f8753c90c7 Bug 29755: Check each NoIssuesCharge separately
This patch updates SIP patron code to use account methods to calculate balances
over the patronflags returns. It also checks if patron should be blocked for each
'No Issues charge' preference

Tests are added for NoIssuesChargeGuarantees

To test:
 1 - Set noissuescharge preference to 5
 2 - Add a $10 charge to a patron
 3 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m patron_information --patron BARCODE
 4 - Note the 64 message starts with Y's that mean patron is blocked
 5 - Set noissuescharge to 11
 6 - Repeat 3, patron is no longer blocked
 7 - Set NoIssuesChargeGuarantees to 8
 8 - Repeat 3, patron is blocked
 9 - Pay $3 on patron so they owe 7
10 - Repeat 3, patron is not blocked
11 - Add a child account with patron as guarantor
12 - Repeat 3, patron is not blocked
13 - Add a $4 charge to child
14 - Repeat 3, patron is blocked
15 - Repeat 3, but with child barcode, child is not blocked
16 - Set NoIssuesChargeGuarantorsWithGuarantees to 10
17 - Repeat 3, patron is blocked
18 - Repeat 3 with child barcode, child is blocked

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f747d38aea)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-02-17 13:38:27 +01:00
Nick Clemens c0fa919492
Bug 22042: Block all return actions when BlockReturnOfWithdrawn items is set to block
Currently this syspref only bokcs the literal 'return' from a patron, i.e. the checkin

It still processes transfers, refunds lost items, updates NotForLoan status etc.

We should block all of these things

To test:
1 - Set BlockReturnOfWithdrawn to block
2 - Set an item as lost and withdrawn
3 - Check it in
4 - Item is found
5 - Apply patch
6 - Repeat 1-3
7 - Checkin is blocked, item still lost

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 321d8f7ce6)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-26 14:55:04 +01:00
Jonathan Druart aee75b61fc
Bug 32349: Remove TEST_QA
There is an env var that we are passing from koha-testing-docker, TEST_QA.
It's used in Koha from a single test file, t/00-testcritic.t.
If not set, no test is run.

Do we really need this? libtest-perl-critic-perl is packaged and automatically installed.

Signed-off-by: Mason James <mtj@kohaaloha.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0adc264edb)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit a375a94225)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a5e6294167)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-26 14:25:46 +01:00
David Cook c713d1c357
Bug 20596: Add unit test for multiple values in authority search
This patch adds a unit test which returns 2 authority records
via an implicit OR when searching for strings from two different
authority records.

Test plan:
1. prove t/db_dependent/Search.t

Signed-off-by: Jan Kissig <jan.kissig@th-wildau.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76d676a868)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5921e1c523)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8146d064b5)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-26 11:45:27 +01:00
Jonathan Druart 81b0a77e8a
Bug 32622: Fix Auth.t on D10
It's caused by a version mismatch of Test::MockModule with D10,
which does not have this commit: fef9e742e4

We should remove the chaining here.

Test plan:
Confirm that Auth.t still pass, and is fixed on D10

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d3b4edf009)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit b36b7d5751)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3622b51abb)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-26 10:02:33 +01:00
Jonathan Druart 527b2b634f
Bug 29458: Fix selenium test
The authentication.t selenium tests (and a couple of others) were
failing with:
Error while executing command: element not interactable: Element <input class="btn btn-primary" type="submit"> could not be scrolled into view at /usr/local/share/perl/5.32.1/Selenium/Remote/Driver.pm line 411. at /usr/local/share/perl/5.32.1/Selenium/Remote/Driver.pm line 356.

We changed the other of the form, and t::lib::Selenium::submit_form was
not getting the correct (first) form. The one from the auth modal was
retrieved and submit button was clicked. Selenium raised an error as it
is not displayed.
The ->is_displayed selenium method does not work, as per the doc
"""
Note: This does *not* tell you an element's 'visibility' property; as it still takes up space in the DOM and is therefore considered 'displayed'.
"""
https://metacpan.org/pod/Selenium::Remote::WebElement#is_displayed

"The internet" is saying we should be able to use the following in our
xpath expression: not(ancestor::div[contains(@style,'display:none')]
but it actually only works if the display:none rule is defined on the
node (not from .css). Which does not work for us.

The only solution I found is to check for the size of the element, which
is (0,0) if not effectively displayed.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5520b8fb84)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 17:45:46 +01:00
Arthur Suzuki 7c0a1a25e3
Revert "Fix selenium tests"
This reverts commit 83805af568.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 17:44:39 +01:00
Arthur Suzuki 83805af568
Fix selenium tests
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 17:32:33 +01:00
Arthur Suzuki b79befe267
Revert "Bug 32208: Extend Auth.t"
This reverts commit 5529e5a0ca.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 14:56:30 +01:00
Marcel de Rooy 45dca37ea9
Bug 31908: [21.11.x] Fix Auth.t
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 11:28:13 +01:00
Marcel de Rooy 5529e5a0ca
Bug 32208: Extend Auth.t
Test plan:
Without follow-up patch, Auth.t should fail:
    not ok 5 - No permission response
    not ok 6 - checkauth returned failure

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a1134bfd8a)
2023-01-11 12:07:04 +00:00
Jonathan Druart 93777723f3
Bug 31908: Add selenium tests
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e378ee05f4)
2023-01-11 12:07:03 +00:00
Marcel de Rooy 3b8f75bb5e
Bug 31908: Add a test to show issue
Test plan:
Without next patch, run Auth.t.
Should fail now before next patch resolves problem:
    not ok 2 - Login of patron2 approved
    ok 3 - Did not return previous session ID
    not ok 4 - New session ID not empty

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d916250d31)
2023-01-11 12:07:03 +00:00
Tomas Cohen Arazi 352060d767
Bug 31086: (follow-up) There's no ->fill in 21.11
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-12-23 11:43:22 -03:00
Jonathan Druart 56ada053c4 Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls
We are seeing the following lines several times in the codebase
  $cache->clear_from_cache("default_value_for_mod_marc-");

But values are never set for this key.

Test plan:
Ask you, "Is the above correct?"
Use the correct 'git grep' and 'git log' and confirm the assertion.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 93d44d1875)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 867c03bf6a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 17:01:38 +01:00
Janusz Kaczmarek 03e8300d57 Bug 19693: Add test sub to Merge.t
In those rare cases when authorities are updated by an external agency (or
even internally, by reviewing and correcting an exported authority file)
when the heading tag will be changed (seems odd but happens:

111 Congress ==> 110 Corporate body.Congress ;
100 Person ==> 110 Corporate body (a company named with person's name ;
151 City--object ==> 150 Object (city) etc.)

and then the authority record in Koha database will be updated with
bulkmarcimport or by calling directly ModAuthority from a custom script,
the merge function "doesn't know" that the change to the authority type
has been made and, consequently, doesn't adequately change the tag in
related fields in biblio records (as it would if two different records
with different authtypecode were merged with Koha interface).

This is because at the moment when merge function is being called
by ModAuthority:
Koha::Authority::Types->find($autfrom->authtypecode)
Koha::Authority::Types->find($authto->authtypecode)
both have the same value (because $mergefrom == $mergeto).

Therefore in case when $mergefrom == $mergeto and the heading tag changes,
$authtypefrom and $authfrom calculated in merge in the ordinar way are
misleading and should not be taken unto consideration.

Test plan:
==========

1. run t/db_dependent/Authority/Merge.t
2. you should see problems in "Test update A with modified heading tag
   (changing authtype)"
3. apply the patch
4. run t/db_dependent/Authority/Merge.t again
5. the test should pass

Alternatively:

1. have an authority record used in biblio;
   export it to file;
   change 1XX heading tag to a different (but reasonable) value
   and possibly change also the content of the heading
   (one can delete also 942 but it doesn't matter);
   make bulkmarcimport.pl -a -update -file <modified_auth_file> and
   see that the tag in biblio record has not been changed (whereas
   the type of authority record did change);

2. make orders in database (so that the authority type and the tag of
   the field in biblio record correspond); apply the patch;

3. repeat the test from 1.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4d75a9b3b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1ac516addb)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 16:52:03 +01:00
Nick Clemens cbd00bc2fc Bug 31644: Add copy test and clarify some functions
This patch adds a tst for copy without subfields. I also clarify what eachstep does
so the next user/coder understands current behaviour

Update existing or add new: In the case where the field/subfield exists
we update, if we have two fields - one with the subfield, and one without, we
add the subfield to the one without

Copy field:
 - If given a subfield - we will add to existing fields in the record
 - If not given a subfield - we create an entirely new field

The logic of all of this is tricky, makes sense in a certain light, any complaints
are for a new bug :-)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 74742f5276)
(cherry picked from commit 98fe1f204a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 15:31:51 +01:00
Nick Clemens daab4314a6 Bug 31644: Unit test
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ab009cc9a)
(cherry picked from commit 17c6bdde3f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 15:31:51 +01:00
Kyle Hall a5080a81c0 Bug 31920: Add transaction to subtest in t/db_dependent/Holds.t
A subest in t/db_dependent/Holds.t leaves behind database cruft.

Test Plan:
Using koha-testing-docker:
1) SELECT branchcode FROM branches
2) prove t/db_dependent/Holds.t
3) SELECT branchcode FROM branches
   Note cruft
4) reset_all
2) prove t/db_dependent/Holds.t
3) SELECT branchcode FROM branches
   No cruft!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b8b02a587)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 992d2b01f7)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 14:42:48 +01:00
Kyle M Hall b4f6dc92e1 Bug 31684: Set Koha::Plugin::Test version to 'v1.01'
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a26cc8a29b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8b81824e32)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 14:33:33 +01:00
Mason James 2316dc2be5 Bug 31883: Filter trim causes false warnings
Test plan:
Run xt/find-missing-filters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 246efd2e9b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 43ba61af5b)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 14:30:55 +01:00
Kyle Hall 479ef38873 Bug 31552: SIP2 option format_due_date not honored for AH field in item information response
Bug 28730 added the ability to format due dates based on Koha's date format, but missed formatting the due date field in the item information response.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 93e418c0b3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c7b340508)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 16:20:28 +01:00
Nick Clemens 624376b6cb Bug 29561: Unit test
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c473480d4e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5b6b095f1f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 15:33:27 +01:00
Tomas Cohen Arazi 77a3aff3aa Bug 31587: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc7cc1467d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a09d225815)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 15:24:13 +01:00
Fridolin Somers b9df1bf22b Bug 31649: Add unit tests
Creates new test file GetBasketGroupAsCSV.t

Test with :
prove t/db_dependent/Acquisition/GetBasketAsCSV.t
prove t/db_dependent/Acquisition/GetBasketGroupAsCSV.t

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 193d6c48a4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f076d3b66d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 14:38:57 +01:00
Marcel de Rooy fd0f1adceb Bug 31593: Remove Test::DBIx::Class from Context.t
No need to keep it.
Fixing a test description too.

Test plan:
Run t/db_dependent/Context.t

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 499562f0b8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3088c2f56a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 10:53:26 +01:00
Julian Maurice 1f926a8772 Bug 31441: Fix Koha::Item::as_marc_field when kohafield = ''
marc_subfield_structure.kohafield can be NULL, but it can also be an
empty string. But in that case, Koha::Item::as_marc_field ignores them,
which means the resulting MARC::Field object has missing data.
This can produce a bug in OPAC ISBD view (and probably other places
where this method is used)

Test plan:
1. Edit the default biblio MARC framework for the item field: find or
   create a subfield that is not linked to a DB column.
   Save even if you made no changes to make sure that
   marc_subfield_structure.kohafield is set to an empty string.
   I'll use 995$Z as an example for the following steps.
2. Add the following to syspref OPACISBD:
    #995|<br>Item:|{995Z}|
3. Create a biblio with an item and put a value into 995$Z
4. Go to the ISBD detail page for this record at OPAC. Confirm that the
   value you entered in 995$Z is not visible
5. Apply patch and restart koha
6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible.
7. Run `prove t/db_dependent/Koha/Item.t`

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 389b9dfaf4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 272510faf7)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 10:44:49 +01:00
Arthur Suzuki 6045114224 Revert Bug 31421
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-21 10:56:22 +01:00
Julian Maurice ba48564356 Bug 25375: Fix QueryBuilder.t tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4f09abd5c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3a2ac10bcf)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 18:16:23 +01:00
Nick Clemens b70eb7f8b0 Bug 25375: Adjust tests and test itemlost, not notforloan
Previous commit correctly lists Zebra availability test, but was a
bad edit. This fixes the availability test to use itemlost

Additiionally, tests were written before limits were agreed. Adjusted
for the current settings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 471facdf26)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 544b89cf90)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 18:16:23 +01:00
Julian Maurice fd5a9df95b Bug 25375: Add tests for the "available" ES field
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f48c5bbb8b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 97b58633d0)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 18:16:23 +01:00
Julian Maurice eaa45e93db Bug 27550: Add unit test for CloneBudgetHierarchy
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ca338bae1e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c7074be1c9)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 17:50:42 +01:00
Marcel de Rooy c9056ce0ac Bug 31598: Fix random failure on Jenkins for Upload.t
At some point the warn is made conditional for permanent
files. So it failed when TestBuilder picked a zero value
for permanent. Trivial fix.

Test plan:
Run t/db_dependent/Upload.t a few times

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9a92ee3194)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d7bf6f7084)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 17:32:13 +01:00