Commit graph

3625 commits

Author SHA1 Message Date
eba6327299 Bug 18235: (QA follow-up) Series facet name after rebase
Bug 19575 changes many field names so "se" facet field became "title-series"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 15:18:48 +00:00
Alex Arnaud
854a750376 Bug 18235: Add unit tests for get_facetable_fields
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:48:53 +00:00
1218364dbe Bug 12159: Add tests
Test plan:
prove t/db_dependent/Koha/Patron/Attributes.t t/db_dependent/Koha/Patrons.t

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 13:05:22 +00:00
Galen Charlton
cc2a62bdee Bug 10577: Improve semantics of GetBudgetPeriod()
Remove the option to pass zero to this function in
order to get "the" active budget.  This was a problem
in three ways:

- Koha doesn't require that there be only one active
  budget at a time, so the concept of "the" active
  budget doesn't make sense.
- Having the single parameter be either an ID or a flag
  based on its value is poor function design.
- No callers of GetBudgetPeriod() were actually using this
  modality.

This patch also improves the DB-dependent tests for budgets by

- wrapping the test in a transaction
- counting budgets correctly

To test:

[1] Apply the patch.
[2] Verify that prove -v t/db_dependent/Budgets.t passes
[3] Verify in the staff interface that:
    - the budget hierarchy displays correctly
    - you can add and modify a budget

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 12:46:14 +00:00
2be687c419 Bug 22008: (follow-up) Additional fix for bad test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-27 15:04:59 +00:00
918328171b Bug 22008: (follow-up) Additional test fix and fix typo
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-27 13:13:48 +00:00
c31a50d06a Bug 22008: Fix failing tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-27 12:34:38 +00:00
607eb83bc0 Bug 22565: (QA follow-up) Fix test Acquisition.t
Test plan:
prove t/db_dependent/Acquisition.t
should pass

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-25 12:12:53 +00:00
9bf2b27df5 Bug 22565: Add test for ModReceiveOrder regression
This test checks that order_internalnote is only updated for the given
orderline in ModReceiveOrder.

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-25 12:12:53 +00:00
Andrew Isherwood
8378c74c90 Bug 18589: (follow-up) Add borrowernumber test
As per comment #21:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18589#c21

We now test borrowernumber filter works. This test has come from
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83184&action=diff
and will be removed from that bug

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 20:21:49 +00:00
e9fa69ca64 Bug 21998: Silent tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 20:21:45 +00:00
ee73d577ed Bug 21998: Throw exception on bad pattern
Signed-off-by: Josef Moravec <josef.moravec@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: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 20:21:44 +00:00
b794643bb0 Bug 21998: Add pattern parameter in Koha::Token
Allow a pattern too in Koha::Token->generate. Only supported length.
Does not affect CSRF calls. So tiny change without further impact.

Test plan:
Run  t/Token.t

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 20:21:43 +00:00
ee1f262f14 Bug 22008: Fixes to make unit tests pass
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 20:02:45 +00:00
4e067c83e4 Bug 22008: Add tests for new constraints
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 20:02:43 +00:00
2851d66254 Bug 20478: (QA follow-up) Make test more standard
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 19:46:31 +00:00
Andreas Jonsson
e7e27a934a Bug 20478: Have the cronjob script advance_notices.pl send digest messages per branch.
Desired behavior of the script advance_notices.pl is that the sender
address on the notice message is that of the branch of the issues in
question.  Thus, the solution is to generate digest messages per
branch.

To test:
1) Inspect unit test in t/db_dependent/cronjobs/advance_notices_digest.t and note that:
   - There are three libraries
   - There is a borrower
   - The borrower is registered at library1
   - The borrower has message preference wants_digest set to 1
   - The borrower has message preference days_in_advance set to 1
   - The content of the letter PREDUEDGST is '<<count>> <<branches.branchname>>'
   - There are three items
   - There is one issue per item
   - There is one issues at library2
   - There are two issues at library3
   - The date_due of the issues are set to tomorrow
   - For the default case (no -digest-per-message)
      - It is asserted that there is one message in the message queue after running the script
      - It is asserted that there are three items in the message.
      - It is asserted that the branchname is that of the borrower's home library.
   - For the case where -digest-per-message is enabled
      - It is asserted that there are two messages in the message queue after running the script
      - It is asserted that the item count of the message corresponding to library2 is 1
      - It is asserted that the item count of the message corresponding to library3 is 2
      - It is asserted that the branchnames are correct.
2) Run unit test: prove t/db_dependent/cronjobs/advance_notices_digest.t

Sponsored-By: Bibliotek Mellansjö, which is a cooperation between
Sponsored-By: Gullspångs kommunbibliotek
Sponsored-By: Hjo stadsbibliotek
Sponsored-By: Karlsborgs bibliotek
Sponsored-By: Mariestads stadsbibliotek
Sponsored-By: Skövde stadsbibliotek
Sponsored-By: Tibro bibliotek
Sponsored-By: Tidaholms stadsbibliotek
Sponsored-By: Töreboda kommunbibliotek

Signed-off-by: Andreas Jonsson <andreas.jonsson@kreablo.se>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Adding the --digest-per-branch switch turns the digest into one digest per
library. I think it makes perfect sense to keep the default behaviour
and hide this new functionality behind a command line switch.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 19:46:31 +00:00
Andreas Jonsson
5b97398a3a Bug 20478: Add unit test for advance_notices.pl cronjob.
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 19:46:29 +00:00
48484173e2 Bug 19661: (follow-up) Use Basic auth in tests
Test plan:

prove t/db_dependent/api/v1/acquisitions_funds.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 19:40:37 +00:00
Matthias Meusburger
717975abeb Bug 19661: REST API - Funds Endpoint
This patch adds a new route to the REST api:

/api/v1/acquisitions/funds/

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 19:40:36 +00:00
c194d0e147 Bug 22330: Fix tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 13:06:49 +00:00
a98e7521be Bug 21683: (follow-up) Remove last occurences of statistics.proccode
columns.def is used to define descriptions of db columns in guided
reports

test is not useful anymore IMO

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 18:19:23 +00:00
bb231e6208 Bug 21683: (follow-up) Polish the change - based on feedback
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 18:19:22 +00:00
6e3da5397e Bug 21683: Remove accountlines.accountno
Test plan:
1) Play with fines, should work OK
2) Try to print receipts on fines - prinfeercpt.pl, printinvoice.pl
3) git grep getnextacctno -> no occurences
4) git grep accountno should return only:
  installer/data/mysql/atomicupdate/bug_21683_remove_column_accountno.perl
  installer/data/mysql/update22to30.pl
  misc/release_notes/release_notes_3_10_0.txt
  misc/release_notes/release_notes_3_22_0.txt
5) prove
  t/db_dependent/Accounts.t
  t/db_dependent/ILSDI_Services.t
  t/db_dependent/Stats.t
  t/db_dependent/Koha/Account.t

Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 18:19:22 +00:00
0aeae50229 Bug 18736: Calculate tax depending on rounding
Marcel's comments pointed out that while I tried to avoid storing
rounded values it is required for tax generation.

This patch makes that change and adds test coverage and POD for
populate_order_with_prices

To test:
Follow plan on other patches, ensure that orders and totals match on the
basket, invoice, and budget pages

prove -v t/db_dependent/Acquisition/populate_order_with_prices.t

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:29:06 +00:00
2f5e839bf7 Bug 18736: (QA follow-up) Change to signed, add large int test
[1] Add trivial subtest in t/Number/Price.t
Checking a negative number and a large number for the MAX_INT change.
Note: Confusing to have t/Prices.t too.

[2] Change UNSIGNED to SIGNED in get_rounding_sql. Although I did not spot
problems with negative prices, we theoretically could while casting.
cast(-2 as unsigned) == 18446744073709551614

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:29:06 +00:00
ca28c83abb Bug 18736: (follow-up) Remove duplicate code and adjust tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:29:06 +00:00
d9b3d0fa36 Bug 18736: Unit tests for GetBudgetHierarchy
prove -v t/db_dependent/Budgets.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:29:06 +00:00
Mark Tompsett
b17ca2b701 Bug 18736: (follow-up) Add missing test cases
We now fully cover GetBudgetsPlanCell in these tests

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:29:05 +00:00
00cf699c82 Bug 18736: (follow-up) Add tests and FIXME for GetbudgetsPlanCell
prove t/db_dependent/Budgets.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:29:05 +00:00
bf0882252f Bug 18736: Unit tests for rounding
Unit tests to highlight the issue

To test:
Prove t/db_dependent/Budgets.t
prove t/Acquisition.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:29:00 +00:00
cde6c897d5 Bug 22330: (QA follow-up) Fix number of tests in Reserves.t
Test plan:
prove t/db_dependent/Reserves.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:22:56 +00:00
a57723fc59 Bug 22330: Transfer limits should be respected for placing holds in staff interface and APIs
Branch transfer limits are respected for placing holds in the OPAC but nowhere else. This should be remedied.

Test Plan:
1) Set up a branch transfer limit from Library A to Library B
2) Verify you cannot set up a hold for an item from Library A for pickup at Library B from the staff interface ( without overriding )
3) Verify you cannot place that hold via ILS-DI
4) Verify you cannot place that hold via SIP
4) Verify a forced hold from Library A to Library B will not show up in the holds queue

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 16:22:56 +00:00
dccc6242ff Bug 22454: (RM follow-up) Adjusts tests to avoid random failure
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-18 11:17:31 +00:00
5c2f3d236a Bug 22455: Unit tests
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 05:31:32 +00:00
eabd2f0e54 Bug 22454: Unit tests
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 05:31:31 +00:00
f97d88ef64 Bug 21756: Fix spelling error
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 04:02:51 +00:00
6f5f675194 Bug 21756: (follow-up) Replace newly introduced manualinvoice call
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 03:58:31 +00:00
0c0ac4161e Bug 21756: (follow-up) Add test for deprecation warning
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 03:58:31 +00:00
913b130ee4 Bug 21756: (QA follow-up) Fix Circulation.t
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 03:58:30 +00:00
0118ccf9dd Bug 21756: (QA follow-up) Correct the test for 'Lost Item' offsets
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 03:58:30 +00:00
e0e431bab1 Bug 21756: Replace manualinvoice with add_debit in tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 03:58:28 +00:00
20ce110f5c Bug 21832: add unit test
Adds a check that is_expired exists in service GetPatronInfo.

Test plan :
Run : prove t/db_dependent/ILSDI_Services.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: remove ref to bug number, we have git for that

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-13 03:49:50 +00:00
6ebcc255d3 Bug 22206: (follow-up) Voted RFC changes
This patch changes expiration_date for end_date as voted when the RFC
was approved.

It also adds a test for the Location header being added correctly when
suspending a hold (SWAGGER3.4.1)

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:35:30 +00:00
1db9598e81 Bug 22206: (QA follow-up) Fix tests for hold suspension api
Test plan:

prove t/db_dependent/api/v1/holds.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:35:30 +00:00
bcc150a9c0 Bug 22206: Unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:35:30 +00:00
52bb9802dd Bug 20006: Unit tests fixes
This patch makes the holds endpoint tests pass and expect data structures that match the voted RFC.

As we voted to introduce a /public namespace for unprivileged access to
endpoints, this endpoint gets the ability for owners and guarantors to
manipulate holds through the API.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:35:26 +00:00
5053ceda3c Bug 20563: (QA follow-up) Fix number of tests in api/v1/illrequests.t
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:33:37 +00:00
Andrew Isherwood
0c41d86314 Bug 20563: (follow-up) Add unit test
Test that requested partners are returned in API response when requested

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:33:37 +00:00
Andrew Isherwood
9e8c18572b Bug 18837: (follow-up) Add additional tests
As requested by Josef on IRC, we now mock the unmediated_ill backend
method and ensure it is called when the ILLModuleUnmediated syspref is
enabled and ensure it is not called when the syspref is disabled

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:33:36 +00:00
Andrew Isherwood
7413de82f2 Bug 21063: Add "Columns settings" for ILL
This patch adds the "Columns settings" values for the illrequests table

Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Bug 21063: Add ability to show / hide columns

This patch adds the "Column visibility" functionality to the main ILL
request list table.

To test:
- Ensure ILL is enabled and you have some requests
- Apply patch
- From the "Koha administration screen, select "Configure columns"
- In the "Columns settings" page:
  => TEST: Ensure an "Interlibrary loans" category exists
  - Upon expanding the category:
  => TEST: Ensure a table is displayed showing columns
  => TEST: Ensure the "action" column has "Cannot be toggled"
  pre-selected
  => TEST: Change values for columns and ensure they're saved
- From the main staff menu, select "ILL requests"
- In the table:
  => TEST: Click the "Column visibility" button and ensure a modal
  containing all columns (except "Action")  is displayed
  => TEST: Select various columns and ensure they are shown and hidden

Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Bug 21063: (follow-up) Add user ID to column list

As originally specified in bug 20883, there is a requirement for some
users to be able to display the user ID (borrowernumber) in the UI.

This patch adds that ability to this bug, 20883 will be marked as a
duplicate of this one.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Bug 21063: (follow-up) Amendments for rebase

Modify to add the additional changes required now we're rebasing on top
of the dependency tree. Includes adding additional columns (and changing
indexes for search/filter where appropriate)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Bug 21063: (follow-up) Add comments to column list

Since this bug is now dependent on Bug 18591 (Allow an arbitrary number
of comments on ILLs) we need to add the comments column to this table
and the list of selectable columns. This patch does this.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Bug 21063: (follow-up) Sanitize datatable data

This mitigates bug 22268 by sanitizing data prior to display using the
built in $.fn.dataTable.render.text() helper provided by Datatables.

The patch was added here, rather that in 22268 since this is the bug
that introduced the problem by increasing the number of fields that are
displayed in the table, some of which could contain user provided
malicious data

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:33:36 +00:00
Andrew Isherwood
58b81110dc Bug 20750: Add unit tests
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Bug 20750: (follow-up) Remove status_alias test

This test is now redundant.

We can't test the return of $req->status_alias against the value of
$req->{status_alias} any more since we've overloaded the status_alias
method and it won't always return the value of the object's property.

We test the functionality of the status_alias method elsewhere so we're
still covered.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:07:08 +00:00
Andrew Isherwood
79d64a37a0 Bug 20750: Allow logging of arbitrary actions
This patch allows logging of arbitrary actions on request objects. A
chronological summary of these actions can then be displayed when
viewing a request.

This patch also adds logging of request status changes. Additional work
has been done on the BLDSS backend to log requests to the BLDSS request
status check API.

To test:
- Apply patch
- Ensure the Illlog logging preference is turned on
- Create an ILL request and perform actions on it that change it's
status.
- Navigate to the "Manage ILL request" screen
- Click the "Display request log" button
- Observe that a modal opens displaying a summary of the status changes.

Signed-off-by: Niamh Walker <Niamh.Walker-Headon@it-tallaght.ie>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Since this bug now is dependent on Bug 20581, it should be aware of the
custom statuses provided in 20581. This patch enables logging of request
statuses being changed to custom ones. As such the test plan is
modified:

To test:
- Apply patch
- Ensure the Illlog logging preference is turned on
- Ensure you have some custom request statuses defined in the
Authorised Values ILLSTATUS category
- Create an ILL request and perform actions on it that change it's
status.
- Edit the request and change status to a custom one
- Navigate to the "Manage ILL request" screen
- Click the "Display request log" button
- Observe that a modal opens displaying a summary of the status changes.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 19:07:08 +00:00
2be9fd23d2 Bug 22219: Add tests
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:36:11 +00:00
180781f474 Bug 21846: Simplify ugly double for loops
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:27:44 +00:00
865f9a165d Bug 21846: Regression tests for add_tag_approval
Due to collation issues, add_tag_approval wrongly calculates
the weight for strings including extended UNICODE characters.

This patch introduces a test for this situation.

To test:
- Apply this patch on master
- Run:
  $ kshell
 k$ prove t/db_dependent/Tags.t
=> FAIL: Tests fail because all extended characters match the same

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:27:44 +00:00
6c86de628d Bug 21846: Add Koha::Tags::Approval(s) and Koha::Tags::Index(es)
In order to avoid writing the tests using plain DBIC which would later
need to be replaced by a Koha::Object-based counterpart, I introduce
this stub classes.

Stub tests are added as well.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Tags.t \
          t/db_dependent/Koha/Tags/Approvals.t \
          t/db_dependent/Koha/Tags/Indexes.t
=> SUCCESS: Tests pass
- Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:27:44 +00:00
1464328718 Bug 21987: (RM follow-up) Add text for simple tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:22:32 +00:00
afb39b132b Bug 21987: Add tests
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:19:55 +00:00
ed5b7e4575 Bug 22493: Clean up DecreaseLoanHighHolds.t
To test:

1 - prove -v t/db_dependent/DecreaseLoanHighHolds.t
2 - should pass
3 - read code, confirm changes make sense

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:17:59 +00:00
d48ae4adaf Bug 14591: (QA follow-up) Fix AddReturn call in Circulation/issue.t
Test plan:
prove t/db_dependent/Circulation/issue.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:14:03 +00:00
004609e468 Bug 14591: Update unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:14:03 +00:00
9f5a1bc7eb Bug 22043: (QA follow-up) Add parameter to control behavior
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:10:46 +00:00
1934ca1100 Bug 22222: Don't send empty params to mana service
Test plan:
0) Do not apply the patch
1) Go to serials > Search on Mana
2) Insert some value into the form
3) Submit -> you get many (3000+) results
4) Apply the patch and restart_all
5) Repeat, now, you get only the subscription matching your query

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:08:42 +00:00
99ea714345 Bug 21560: Unit test for Koha::Util::OpenDocument
Run prove t/Koha/Util/OpenDocument.t

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:02:46 +00:00
deb968ea45 Bug 22296: Add Invoice Adjustments to GetBudgetHierarchy
To test:
1 - prove -v t/db_dependent/Budgets.t
2 - Create some invoices on a single budget
    Invoice 1:
      add a non-encumbered adjustment for 1
      add an encumbered adjustment 2
      leave open
    Invoice 2:
      add a non-encumbered adjustment for 4
      add an encumbered adjustment for 8
3 - View acq home page, should see 2 order and 12 spent for the budget
4 - View the spent and ordered pages, they should show the correct amounts
5 - Add more orders etc and confirm things total correctly

https://bugs.koha-community.org/show_bug.cgi?id=22296
Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 11:33:39 +00:00
b701ceae34 Bug 22368: Make sure the tests will always pass
Who knows!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:53:29 +00:00
3459fd9493 Bug 22368: (QA follow-up) Mute db errors in test
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:53:29 +00:00
dc644fcb0a Bug 22368: Add tests
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:53:29 +00:00
bc269304f4 Bug 19489: (QA follow-up) Update test to use objects and module methods for creating needed data
Test plan:
prove t/db_dependent/Koha/Account/Lines.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:45:58 +00:00
Nazlı Çetin
ac3223342e Bug 19489: (follow-up) Fix typos in the tests
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:45:58 +00:00
Nazlı Çetin
add47bf472 Bug 19489: Change method name issue --> checkout
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:45:58 +00:00
Nazlı Çetin
7bdbea0417 Bug 19489: Koha::Account::Line->issue method and Unit test
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:45:58 +00:00
d885aefcd5 Bug 22392: Reuse existing pattern
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:36:01 +00:00
3189df3ac9 Bug 22392: Allow barcode to be passed to build_sample_item
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 12:36:01 +00:00
aeab8b50f4 Bug 22363: Update Circulation.t to use Koha::ActionLogs instead of GetLogs
Test plan:
prove t/db_dependent/Circulation.t

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 11:22:00 +00:00
bc7d038ac0 Bug 22363: Add tests
Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-11 11:22:00 +00:00
d0c76286a2 Bug 15774: (follow-up) Fix TestBuilder.t so it doesn't catch wrong classes
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2019-03-09 05:41:45 -03:00
088e0243bf Bug 22483: Restore undef behaviour
Turns out that we rely heavily on the side effect that passing undef
to haspermission would always return true no matter what permissions
or lack of permissions you had.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2019-03-08 15:53:10 -03:00
4cb1a47d03 Bug 22483: (follow-up) Fix wrong tests higlighted by bug
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2019-03-08 15:26:05 -03:00
cc67ff26aa Bug 22483: Explicitly ban 'undef' as a valid $flagsrequired
Before bug 22031 the haspermission subroutine signature allowed for
passing 'undef' to mean 'any permission' in $flagsrequired.  This feels
like a mistake and was only in practical use in two places in the
codebase.

This patch explicitly forbids this practice (`*` may be used to the same
result and is more explicit in it's nature) and replaces the two
instances of it's use.

Test Plan
1. Before this patch, the API tests are all failing with authentication
errors
2. After this patch the API tests should now all pass.
3. t/db_dependent/Auth/haspermission.t should continue to pass (with one
addition subtest added herin)
3. /svc/members/search is not unit tested. Please check that patron
searching still yields results in the UI after this patch.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2019-03-08 15:26:04 -03:00
Ere Maijala
bd68e2f75b Bug 22246: Fix indexing of large fields with Elasticsearch
Deduplicate multivalued fields and make sure sort fields are not excessively long. Also updates default mappings so that sort fields are not created for item fields where it doesn't make sense.

Test plan:
1. Reset ES mappings in administration
2. Check that sort is '0' for local-classification in biblio mappings.
3. Change sort back to '1' for local-classification for the next steps.
4. Create a record with 20 items, each with a 100 character long call number
5. Check that when indexed, the record in ES does not have duplicates in any of the item fields and local-classification__sort is truncated to 255 characters.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:54:04 +00:00
eb7b2907c5 Bug 22416: (bug 22140 follow-up) Remove warnings in Search.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:53:44 +00:00
a8be1966f3 Bug 22031: Add SQL::Abstract like syntax to haspermission
This patch adds an SQL::Abstract inspired query syntax to the
haspermission method in C4::Auth.  One can now pass Arrayrefs to denote
an OR list of flags, a Hashref to denote a AND list of flags.

Structures can be nested at arbitrary depth.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:50:26 +00:00
fa24301598 Bug 15774: (QA follow-up) Fix use statemenets
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:37:06 +00:00
9bf62c7881 Bug 15774: Add missing tests for Koha::Object::Mixin::AdditionalFields
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:37:06 +00:00
8035151e41 Bug 15774: (follow-up) Address QA issues
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:37:05 +00:00
Julian Maurice
904a488460 Bug 15774: Use Koha::Object(s) for additional fields
A lot of code can be removed just by using Koha::Object

It also makes fetching and updating additional field values easier.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 20:37:05 +00:00
158b3c3a4c Bug 22466: Do not ask for TT methods to be filtered
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 18:17:32 +00:00
c7ef8e6b2d Bug 22466: Add tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 18:17:32 +00:00
7d71d95072 Bug 20912: (QA follow-up) Rebase error corrections
The automatic rebase after bug 21206 required a helping hand.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:29:58 +00:00
2802f20e38 Bug 20912: (follow-up) Prevent double charging on renewal
This patch updates the tests the ensure we do not double charge for
renewals that take place before the original due date and fixes the
corresponding loging in C4::Circulation::AddRenewal.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:29:58 +00:00
6be54ad120 Bug 20912: (QA follow-up) The default rule already has renewalsallowed=0
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:29:58 +00:00
7b75849412 Bug 20912: (QA follow-up) Fix some test failures
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:29:58 +00:00
45595334e6 Bug 20912: (QA follow-up) Fix TestBuilder
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:29:58 +00:00
a68926d9cb Bug 20912: (follow-up) Improve test coverage
Increase test coverage for CanBookBeIssued and fix a introduced during
the refactoring to Koha::Fees.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:29:00 +00:00
6fe5466e5a Bug 20912: (QA follow-up) Test for distinct accountlines
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:27:36 +00:00
8abb7edc98 Bug 20912: (QA follow-up) Move Fees to Charges::
In preparation for the introduction of Koha::Charges::Fines I have moved
this ::Fees class into the Koha::Charges:: namespace

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:27:36 +00:00
8b4bcb3156 Bug 20912: (QA follow-up): Fix up unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:27:36 +00:00
84647ff006 Bug 20912: Move calculation to Koha::Fees
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:27:36 +00:00
62a4969057 Bug 20912: (QA follow-up) Make unit tests reliable and get rid of perl warnings
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:27:36 +00:00
dde914e1f1 Bug 20912: (QA follow-up) Set daily charge to 0 for item type not being used for test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:27:36 +00:00
Katrin Fischer
d9790c6fde Bug 20912: (QA follow-up) Fix number of tests and correct typos
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:27:36 +00:00
3d84f4b9b3 Bug 20912: Rental Fees based on Time Period
Some libraries would like to be able to charge a rental fee based on the
number of days an item will be checked out, as opposed to the flat fee
currently offered by Koha.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Edit an itemtype, add a daily rental fee of 1.00
4) Check an item of that itemtype out for 7 days
5) Verify the patron now has rental fee of 7.00

Signed-off-by: Matha Fuerst <mfuerst@hmcpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-07 17:22:43 +00:00
fcd6bdc5b8 Bug 18925: (RM follow-up) Remove maxissueqty from issuingrule in SIP tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-06 09:29:18 -05:00
32fc535b8a Bug 18925: (QA follow-up) Remove weird 'Null' values for integer column
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-06 13:34:32 +00:00
1fd998f413 Bug 18925: (QA follow-up) Fix Circulation.t
Test plan:
t/db_dependent/Circulation.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-05 20:42:22 +00:00
05a2c58f79 Bug 18925: (QA follow-up) Fix basic_workflow.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-05 20:42:22 +00:00
566bb29766 Bug 18925: Update new occurrences
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-05 20:42:22 +00:00
Jesse Weaver
f9d90a2644 Bug 18925: (follow-up) Change name of rule to fix ambiguity
There was previously an ambiguity between the branch/category/itemtype
specific max{,onsite}issueqty and the total-per-patron max{,onsite}issueqty.
The latter has been renamed to patron_max{,onsite}issueqty.

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-05 20:41:42 +00:00
26a779eded Bug 18925: Move maxissueqty and maxonsiteissueqty to circulation_rules
This patch set moves maxissueqty and maxonsiteissueqty to the
circulation_rules table.

Test Plan:
1) Apply this patch
2) Run updatedatabase
3) prove t/db_dependent/Circulation.t
4) prove t/db_dependent/Circulation/Branch.t
5) prove t/db_dependent/Circulation/GetHardDueDate.t
6) prove t/db_dependent/Circulation/Returns.t
7) prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t
8) prove t/db_dependent/Circulation/TooMany.t
9) prove t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
10) prove t/db_dependent/Reserves.t
11) Note no changes in circulation behavior related to check out limis
    both on and off site

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-05 20:41:42 +00:00
f40a75876e Bug 21720: Update Tests
AddIssuing charge is always called in void context, but the tests
checked that the return value was a Koha::Account::Offset and we now
return a Koha::Account::Line.

This patch changes the test to accept a Koha::Account::Line as returned,
adds a test to ensure a Koha::Account::Offset is also created and
corrects the logic that tests that only one accountline is added.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 19:15:41 +00:00
1fa46154d1 Bug 21722: Tidy up tests and increase coverage
This patch moves the chargelostitem 'branchcode' test to within the
'chargelostitem' subtest block in t/db_dependent/Accounts.t. It also
adds tests for additional accountline fields that should be getting
set by this method and adds tests for ProcessingFeeNote before removing
t/db_dependent/Circulation/Chargelostitem.t which covered this
previously.

Sponsored-by: PTFS Europe

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 19:08:25 +00:00
ec4ea59ec5 Bug 22228: Update test for updated mappings
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 18:37:43 +00:00
Ere Maijala
dd98584c85 Bug 22228: Escape lone colons and make sure term is balanced
Escapes unquoted colons that have whitespace on either side. Removed unbalanced quotes.

Test plan:

1. Make sure the test case described in the bug works
2. Make sure tests pass:
  prove t/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Björn Nylén <bjorn.nylen(at)ub.lu.se>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 18:36:11 +00:00
root
c2061adc8b Bug 19575: Rebase and fix tests
This patch lower cases the sort by fields to normalize checking them and adjusts
some existing tests to meet the new expectations.

The regex for splitting terms has been moved into a subroutine so that adjustment was made

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 18:25:49 +00:00
David Gustafsson
6d53910f0c Bug 19575: Use canonical field names and resolve aliased fields
Adjust elastic search mappings to more closely match Zebra equivalents
resolving serveral issues with coded Zebra searches in templates and
sorting of search results in UI. Also make field names in search strings
case insensitive to accept case variations in template links and user input.

Sponsored-by: Gothenburg University Library

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 18:25:49 +00:00
1a385cae8d Bug 21747: (follow-up) Intelligent rename of offsets
This patch intelligently renames the account_offset types for updateing
fines from `Fine Update` to `fine_increment` and `fine_decrement`
depending on the sign of the calculated difference of the adjustment.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-27 09:14:21 -05:00
57f4c01b9a Bug 22084: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-27 09:14:21 -05:00
d441ce5cda Bug 21765: Regression tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-27 09:14:21 -05:00
f9162c2e5e Bug 22016: Unit tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-27 09:14:21 -05:00
08c83dbc6e Bug 22014: Unit tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-27 09:14:21 -05:00
dae703cb79 Bug 22349: Remove overzealous database deletions from test
For no apparent reason a whole lot of data was being deleted inside a
transaction for each of the subtests in Koha/Acquisitions/Booksellers.t

This patch simply remove the deletions. To test, run the test before and
after applying the patch and they should all continue to pass.. If you
have a large number of booksellers, baskets, orders or subscriptions in
your database you may also see an decrease in the time it takes to run
the test.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-27 09:14:21 -05:00
2a58e32f7d Bug 21206: (QA follow-up) Rebase problem and leftover mocked GetItem
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
c63e73e237 Bug 21206: Fix Returns.t
we are calling several times effective_itemtype
Must be fixed later

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
31c29fd31f Bug 21206: Replace C4::Items::GetItem
Note: This is here for information purpose, feel free to test it if you
wan to play with it.

TODO: C4::Reserves::_get_itype is not longer in use

No more GetItem must be returned by:
git grep GetItem|grep -v GetItemsAvailableToFillHoldRequestsForBib|grep
-v GetItemsForInventory|grep -v GetItemsInfo|grep -v
GetItemsLocationInfo|grep -v GetItemsInCollection|grep -v
GetItemCourseReservesInfo|grep -v GetItemnumbersFromOrder|grep -v
GetItemSearchField|grep -v GetItemTypesCategorized|grep -v
GetItemNumbersFromImportBatch|cut -d':' -f1|sort|uniq

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
54fd0718da Bug 18957: Add tests
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:09:02 +00:00
f0aa1c06a1 Bug 22049: Do not pass Koha::Patron to AddIssue
The tests are not supposed to pass with such obvious mistake (?)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 14:56:32 +00:00
Andrew Isherwood
9f9b809b60 Bug 20581: (follow-up) Fix unit test
Since we're now storing the authorised_value column as the foreign key,
rather than the id, we need to account for this in the test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 14:31:31 +00:00
Andrew Isherwood
790b365831 Bug 20581: Unit tests for status_alias
This patch adds unit tests for the specific status_alias functionality
added in this bug

- Creation of the ILLSTATUS authorised value
- Illrequest->statusalias accessor
- Illrequest->status overloading to reset status_alias

To test:
1) Apply this patch
2) prove t/db_dependent/Illrequests.t

Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 14:31:31 +00:00
569c64252e Bug 21692: (QA follow-up) Enhance test for new
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 13:16:53 +00:00
Jasmine Amohia
34c36a32a0 Bug 21692: created a test for Koha::Account->new
Test plan:
1) Run test for /Koha/Account.t and confirm that all tests were
successful

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 13:16:53 +00:00
8083bc2ff0 Bug 22216: Make GET /patrons/{patron_id} staff only
This patch removes the possibility to access the patron object
identified by patron_id by the patron itself, or a guarantor.

It does so by removing the permissions from the spec. The tests are
adjusted to remove that use case.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 13:15:11 +00:00
d0a6469ad5 Bug 21997: Unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 13:07:58 +00:00
25006c04da Bug 22386: Remove debug statements
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 13:06:04 +00:00
9f27a63b9a Bug 22386: Unit tests
Signed-off-by: Devlyn Courtier <dcourtier@hccc.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-22 13:06:03 +00:00
Andrew Isherwood
91be82a63d Bug 20600: (follow-up) Fix tests
Some silly variable name typos in the tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 16:36:43 +00:00
Andrew Isherwood
69672b8185 Bug 20600: (follow-up) Fix unit tests
The unit tests now need to be aware of the calculated placed_formatted
and updated_formatted properties in the API response object

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 16:36:43 +00:00
e3ca2675a2 Bug 3820: (follow-up) Address lastseen log spamming
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 16:04:44 +00:00
15d4b4fd8b Bug 3820: (follow-up) Update tests to reflect the change of behaviour
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 16:04:44 +00:00
02aa348f65 Bug 16497: Refactor tests using BASIC authentication
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:14 +00:00
562eaa154b Bug 16497: (follow-up) GET operations require staff access
With the introduction of the /public namespace all other endpoints, the
rest of the endpoints are restricted to privileged users.

This patch makes the GET /libraries and GET /libraries/:library_id
endpoints require 'catalogue' permissions.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:14 +00:00
0718416ff1 Bug 16497: (follow-up) Adapt to existing guidelines and RFC
This patch makes the original implementation match what is specified on
the RFC [1].

The controller is updated, and so the tests.

To test:
- Apply this patches:
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/libraries.t
=> SUCCESS: Tests pass!

[1] https://wiki.koha-community.org/wiki/Libraries_endpoint_RFC

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:14 +00:00
Jiří Kozlovský
96456cadc2 Bug 16497: Add /api/v1/libraries
CRUD for libraries via REST API.

GET    /api/v1/libraries              - List all libraries
GET    /api/v1/libraries/{branchcode} - Get one Library
POST   /api/v1/libraries              - Add new Library
DELETE /api/v1/libraries/{branchcode} - Delete Library

Test plan:
  - apply patch
  - run tests: t/db_dependent/api/v1/libraries.t
  - test API with some API tool or simple curl

e.g.:
curl http://host:port/api/v1/libraries
curl http://host:port/api/v1/libraries/cpl

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:14 +00:00
4e139a237b Bug 10676: Add unit tests - GetItemsInfo
To test:
  prove t/db_dependent/Items.t

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 18:42:48 +00:00
6aadbcc4be Bug 22227: Make GET /cities staff only
This patch removes the possibility to access the city objects without
privileged access (minimum permissions == catalogue).

It does so by adding the required permissions to the spec. The tests are
adjusted.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/cities.t
=> SUCCESS: Tests pass!
- Sign off :-D

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 18:42:46 +00:00
50fd86d42f Bug 19832: Unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: maxissueqty      => 10.
Replaced dot by comma.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 18:42:44 +00:00
0da1090d3a Bug 22140: Larger unit test for get_hostitemnumbers_of
Add syspref EasyAnalyticalRecords impact in unit test for get_hostitemnumbers_of

Test plan :
Run t/db_dependent/Items.t

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 13:34:57 +00:00
Alex Arnaud
11b9bb3da9 Bug 13515: Add unit tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 13:12:22 +00:00
3f965b3e37 Bug 17047: (RM follow-up) Fix tests for Ubuntu
In Ubuntu the message returned is:
An error occurred, mana server returned: Can't connect to foo.bar:443 (Name or service not known)

Checking for 'Can't connect' and not enforcing end of string should be sufficient and fixes the test

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-11 20:49:00 +00:00