Commit graph

4060 commits

Author SHA1 Message Date
0f4bc4fd81
Bug 23964: (follow-up) We should check for only active holds when determining to set waiting
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-25 16:38:16 +00:00
95d5be238c
Bug 24013: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-25 08:38:02 +00:00
1ca7b6c40c
Bug 24075: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-22 15:08:28 +00:00
d4589500d1
Bug 24065: Fail shib login if multiple users matched
Ideally you could test against active shib, but is a small code change and
covered by tests and should be readable

To test:
prove -v t/Auth_with_shibboleth.t

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-21 11:33:11 +00:00
b9422bef70
Bug 23964: Clarify and expand tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-21 11:28:15 +00:00
838b8cb2f4
Bug 23964: Unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-21 11:26:42 +00:00
fda209ca50
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>
2019-11-19 15:17:08 +00:00
cbe22553fe
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>
2019-11-19 15:17:08 +00:00
0498ffb633
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>
2019-11-13 16:23:30 +00:00
e5cdf88544
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>
2019-11-13 16:23:30 +00:00
6a2c5d665e
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>
2019-11-13 16:23:30 +00:00
86f999812e
Bug 23765: Do not display localized templates if TranslateNotices is off
To test:
1. Enable multi-languages
2. Set the preference 'TranslateNotices' on  'Allow'
3. Go to: tools==>Notices & slips==>Edit, make sure it has multilingual
email templates.
4. Set the preference TranslateNotices on 'Don't allow'.
5. Go to: tools==>Notices & slips==>Edit, the template shows several tab
for the same transport type.
6. Apply the patch.
7. Repeat the steps 4 and 5
8. Success. It only shows the default template when TranslateNotices is
'Dont allow'.

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>
2019-11-13 13:36:45 +00:00
7aa84d28e5
Bug 24030: Remove OldWay comparaison from GetItemsForInventory.t
This has been introduced to make sure there were no regression at a
given point. But now we are fixing the "old way" so it does not make
sense to keep it any longer

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-13 13:25:24 +00:00
5aa8db502c
Bug 24029: Remove "Truncated incorrect DOUBLE value: '01e'" from marcrecord2csv.t
marc_subfield_structure.tagfield is a varchar(3)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-13 13:22:11 +00:00
9e6fe7ac38
Bug 24022: Try to fix 'connect failed'
I am assuming that the tests fail on Jenkins's nodes because they are
too slow. The server is not setup yet when we are trying to access it.
Just a guess...

Note that sleep is usually a bad idea...

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-13 13:19:48 +00:00
37bc254581
Bug 24022: Remove unecessary delete from authorised_values
Why do we need that exactly?
The cache is not flushed so it should not be needed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-13 13:19:44 +00:00
fab29f7fd4
Bug 24022: Prevent Session2.t to fail if run after Session.t
Cache must be cleaned!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-13 13:19:39 +00:00
6f464191ff
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>
2019-11-08 09:31:47 +00:00
341b8266d7
Bug 23293: (QA follow-up) Minor fix for tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-07 13:18:23 +00:00
5f555d865d
Bug 23293: (follow-up) Add tests for C4::Circulation change
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-07 13:13:29 +00:00
342baeecbb
Bug 23768: Adjust the test for invalid ISBN
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-07 13:02:59 +00:00
f59a34a9ca
Bug 13958: Use SuspensionsCalendar syspref for more granularity
This patch makes the calculation of suspension expiration configuration
detached from the finesCalendar syspref. This way libraries have more
flexibility when setting circ rules.

I wrote this path as a bugfix, because the recent change pushed by bug 19204
changed this behavior and libraries have been complaining since they got
upgraded.

It is a minor change, just adding the new syspref, and replacing the
single place in which it is used for debarment calculation for the new
one.

The tests are updated similarly, just adding the new mocked syspref as
it was with the old one.

To test:
- Apply this patches
- updatedatabase
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation.t
=> SUCCESS: Tests pass!
- Sign off :-D

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-07 09:12:15 +00:00
b28c71a714
Bug 23075: (RM follow-up) Update mock in tests
To prevent GET request redirects we switched from ->request to
->simple_request. This patch updates the mock in the corresponding test
to mock simple_request rather than request.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-07 07:56:17 +00:00
5e3ed8d52d
Bug 23414: Replace delimiter of regexs to ease readability
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 17:14:48 +00:00
6d3ff3c5c0
Bug 23414: Add tests for previous effective_itemtype change
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 17:14:44 +00:00
4b97ca915e
Bug 23414: Unit tests
To test:
1 - Apply this patch alone
2 - prove -v t/db_dependent/XSLT.t
3 - All pass
4 - Apply other patches
5 - prove -v t/db_dependent/XSLT.t
6 - All pass

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 17:14:39 +00:00
4a36c1ac04
Bug 23719: (follow-up) Add warn when passed invalid search field in marclist
Note: I also remove warnings for undefined operation in this patch, is a trivial fix

To test:
prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 17:06:38 +00:00
33595e1a3e
Bug 23719: Allow searching specific fields for matching authorities in ES
To test:
1 - Export your authorities via Tools->Export data
2 - Define a record matching rule in Admin->Record matchign rules
    Use index: LC-card-number
    field: 010$a
3 - Stage the exported records for import and use the rule created above for matching
4 - The process does not complete
5 - Check intranet error logs - exception on unknown marclist
6 - Apply patch
7 - Repeat
8 - Success!
9 - prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 17:06:29 +00:00
b920cb708b
Bug 17359: Use a unicode character in tests
And remove an unused variable.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 17:03:37 +00:00
c58fc50128
Bug 17359: Add tests
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 17:03:17 +00:00
e395844982
Bug 23382: (RM follow-up) Ensure tests pass on Wednesdays
Koha::Calendar assumes we never issue an item on a closed day.. this is
a fair assumption but the hardcoded closed day in our tests means it
does not hold true in this case.

This patch sets the closed day dynamically to prevent such a case.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 14:46:31 +00:00
137f4d1679
Bug 23523: (follow-up) Clarify meaning configurations in tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 12:29:52 +00:00
2e0a69609f
Bug 23523: (follow-up) Adjust tests for new expectations
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-06 12:29:41 +00:00
9b2d782813
Bug 23050: (QA follow-up) Add Koha::Plugins::Tab class
This minimal class encapsulates the tabs to be passed around to the
templates, so error checking on missing bits is done in a single place.

It throws exceptions on errors

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-05 08:13:59 +00:00
f601941b50
Bug 23523: unitprice tax column values are not populated if entered upon ordering
To test:
 1 - Add an item to an acquisitions basket
 2 - Make sure to enter 'Actual cost'
 3 - Check the db:
    SELECT * FROM aqorders WHERE ordernumber={your ordernumber}
 4 - Note that unitprice_tax_included and unitprice_tax_excluded are not populated
 5 - Apply patch
 6 - Edit that order
 7 - Check DB
 8 - Values should be populated
 9 - Place another order, ensude values populated on creation
10 - QA people: prove -v t/db_dependent/Acquisition/populate_order_with_prices.t

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-05 08:11:29 +00:00
549a09c521
Bug 23234: Mock DateTime->now using the time zone
The timezone of the two dt was different, one was UTC, the other one was
my local one.
When we mocked DateTime->now we did not use the time zone, we must use
dt_from_string instead

Test plan:
Make sure your environment has a different time zone than UTC
`prove t/db_dependent/Circulation.t` should fail without this patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-04 17:26:24 +00:00
88db3b587e
Bug 23181: Extend unit tests
Run t/db_dependent/Accounts.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-04 14:20:26 +00:00
86e3a73e49
Revert "Bug 21987: Add tests"
This reverts commit afb39b132b.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-04 13:21:58 +00:00
dc9e2a4e69
Revert "Bug 21987: (RM follow-up) Add text for simple tests"
This reverts commit 1464328718.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-04 13:21:42 +00:00
6ce9ce442d
Bug 23903: (QA follow-up) Fix selenium tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-04 11:04:51 +00:00
3675e9cf78
Bug 22581: (RM follow-up) Add sysprefs to Search.t
This patch adds explicit disablement of the sysprefs introduced by this
bug to the Search.t test to silence warnings.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-04 10:45:19 +00:00
Ere Maijala
6e1d759981
Bug 22592: Add index scan emulation to Elasticsearch
Adds support for using the "scan indexes" action in advanced search by using faceting with a prefix filter. Requires that the field be set as facetable for anything to be found.

Test plan:
1. Apply patch
2. Go to advanced search and click "More options"
3. Select author as the search field, enter a last name and check "Scan indexes"
4. Perform search and observe the result list resembling scan results

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-03 07:51:04 +00:00
Ere Maijala
cce9d03bf9
Bug 23089: Fix QueryBuilder tests.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-03 07:34:07 +00:00
fe4a9bdc94
Bug 23089: Unit tests
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-03 07:33:56 +00:00
7ddedd7b42
Bug 21824: Add tests
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-01 08:52:24 +00:00
1bb3ed4f5b
Bug 21824: Add KohaDates method 'output_preference' to make it easy to store formatted dates in TT variable
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-01 08:52:09 +00:00
67d6c469a9
Bug 21824: Add ability to format dates in various formats in templates
This patch adds the ability to set a date format for the Template Toolkit filter KohaDates

Test plan:
1) Apply this patch
2) In a template, use the filter param "dateformat => 'iso'"
3) Note the output is in ISO format

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-01 08:51:50 +00:00
4fd52650bc
Bug 23860: Update tests to new style
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-01 08:48:39 +00:00
e1179b27e0
Bug 23860: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-01 08:48:39 +00:00
7f1f52f2e5
Bug 23859: Update tests to new style
The /cities endpoint is refered in several places as the reference
implementation of a route for devs to pick it for copy and pasting. Yet,
it is outdated in terms of how the tests are written.

This patch rewrites some bits so it uses BASIC auth and the built-ins
Test::Mojo provides.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-01 08:48:18 +00:00
bd7a012c52
Bug 23859: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-01 08:48:17 +00:00
bc8b8a7a6b
Bug 23630: (QA follow-up) Fix tests
marc_records_to_documents is now an arrayref of hashes, not an arrayref of arrays

_sanitise_records has been removed, we don't need those tests anymore

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 13:37:10 +00:00
a9bdeac01a
Bug 22706: (RM follow-up) Add unit tests
Helps if one actually adds the new test file to the commit!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:21:22 +00:00
efa8ef9dcb
Bug 14697: (QA follow-up) Restore FK on issue_id and adjust tests
This patch reintroduces the FK constraint on issue_id. The tests are
adjusted to reflect the UNIQUE constraint we also added.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:05:27 +00:00
bfcbe72edb
Bug 14697: (QA follow-up) Organize tests in subtests
This patch organizes the tests better, and adds some more.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:05:14 +00:00
9dbf0ff0e0
Bug 14697: Make controller methods rely on the stashed user
This patch adjusts the return values and HTTP status codes, as well as
removing the use of C4::Context->userenv. It also makes the date
calculation happen on the DB engine in the case of resolving the claim.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:05:03 +00:00
40e841da98
Bug 14697: (follow-up) Rely on the UNIQUE constraint and return 409 for issue_id
This patch avoids querying the DB for an already existing
Koha::Checkouts::ReturnClaim with the same issue_id, now that there's a
UNIQUE constraint on it.

Also, 409 should be returned instead. Tests added for this changes.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/return_claims.t
=> SUCCESS: tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:04:55 +00:00
a44ffa0926
Bug 14697: Add routes to handle return claims
This patch adds the /return_claims route to add new return claims, and
then routes to updates notes and the resolution code.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/return_claims.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:04:13 +00:00
15d95a74e4
Bug 14697: Add Koha::Patron->return_claims
Adds the ability to get a list of a patron's return claims directly
from the Patron object.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:04:03 +00:00
f08de08858
Bug 14697: Add Koha::Checkout->claim_returned
Adds the ability to generate a return claim from a Checkout object.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:03:56 +00:00
e97887bcbb
Bug 14697: Add return claim handling to AddReturn
This adds the ability to alert a librarian of an item claimed as returned is actually returned.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:03:48 +00:00
e89c5bfed6
Bug 14697: Introduce Koha::Checkouts::ReturnClaim(s)
This patch introduces the Koha::Object(s)-derived classes for handling
return claims. Tests are added to cover the overloaded ->store method,
and domain-specific exceptions are added as well.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Checkouts/ReturnClaim.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 12:03:33 +00:00
Andrew Isherwood
d39c14561f
Bug 15260: Add unit tests
This patch adds unit tests of the CalcDueDate function to ensure that
the useDaysMode "Dayweek" mode works as expected

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 11:52:44 +00:00
d3444b3728
Bug 22706: (RM follow-up) Add unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 11:23:26 +00:00
58da3de84a
Bug 23667: Add route to GET /items
This patchset introduces a route to fetch items. It relies on the
already implemented code/mappings to get a single item.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass!
- Try the endpoint with your favourite API tool (Postman?)
- Sign off :-D

Note: to do exact searching on barcode, you need to build the query like
this:

GET /api/v1/items?external_id=<your_barcode>&_match=exact

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-29 12:20:35 +00:00
fb083813a8
Bug 23630: Do not remove field 999 in Elasticsearch indexing
Elasticsearch indexing uses 999$c to store record id by deleting the all field first !
So you can not store anything in field 999, even in UNIMARC and even in authorities records.

Looks like it is quick fix code added to start Elasticsearch use.

This behavior is disturbing and very strange for UNIMARC flavour.

This patch corrects by defining record ids mandatory in Koha::SearchEngine::Elasticsearch::Indexer::update_index().
This ids array is actually always given (except in UT).
I think it is useless to allow adding a record without its id.

Test plan :
1) Use Elasticsearch as SearchEngine
2) Create a subfield 999$z in default framework
3) Create a record with default framework
4) Enter a random string (never used in catalog) like "tototata" in 999$z
5) In Search engine configuration, define search field "subject" for 999$z
6) Rebuild record : misc/search_tools/rebuild_elasticsearch.pl -b -bn <biblionumber> -v
7) Search for the random string => You get a result
8) Optionnaly look at records in ES : <es server>:9200/<es index name>/data/<biblionumber>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-29 12:13:58 +00:00
618d8a690e
Bug 23858: (follow-up) Return code fix
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-28 12:36:46 +00:00
081b72c08f
Bug 23858: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-28 12:36:32 +00:00
Alex Arnaud
7df185c783
Bug 22874: Use false instead of 0 value for limiting on availability
Test plan

  - Set up a elasticsearch 6 instance to work with Koha,
  - you may need to make koha works with ES 6 (see bug 20589),
  - make a search and limit it to available items only,
  => no result

  - Apply this patch,
  - make a search and limit it to available items only,
  - you should get some results

  - Do the same with ES 5.x

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-28 12:24:34 +00:00
1823316503
Bug 23382: (RM follow-up) Days of the week discrepancies
DateTime and C4::Calander have different notions of 'days of the week'.

DateTime days go from 1..7 (Mon..Sun) whilst C4::Calendar expects 0..6
(Sun..Sat).  This patch adapts the holday setting in the tests to ensure
we work when testing Saturdays and Sundays.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-28 12:20:21 +00:00
d4af82d411
Bug 23382: Use floating time zone to prevent tests to fail because of DST
Today Friday Oct 25th, DST next Sunday => Date math are wrong, 96 hours
diff becomes 95.
To avoid that we use the floating timezone

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:54:34 +01:00
a5bf7b1e55
Bug 23382: (follow-up) Ensure closed day is inside charge window
We're testing with an hourly loan of 96 hours to catch a closed day.
However, our closed day was hard coded to be a Wednesday so if you ran
the tests on a Friday the 96 hour loan would not catch a Wednesday.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:54:29 +01:00
8f3093c9a0
Bug 23382: (follow-up) Further improve test coverage
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:54:11 +01:00
080958231e
Bug 23382: (follow-up) Ensure tests pass on Wednesdays
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:54:03 +01:00
9063d05662
Bug 23382: Add hourly tests for Circulation
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:53:45 +01:00
34e5391d90
Bug 23382: Add tests for hourly calculations
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:53:41 +01:00
28055d3347
Bug 23382: Improve test coverage
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:53:33 +01:00
75fa214835
Bug 17168: (QA follow-up) Only remove guarantor relationship if not Child AND not Professional
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:37:42 +01:00
2fba65eb4d
Bug 17168: (RM follow-up) Update for bug 14570
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-26 07:36:47 +01:00
436ad74399
Bug 17168: (follow-up) Address QA concerns and update for strict mode
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:20:07 +01:00
c7226ad5ea
Bug 17168: (follow-up) Tidy, clean params/options, use date tools
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:19:54 +01:00
af15cbbe1b
Bug 17168: Add a command line script for updating patron category based on status
This patch adds a new script update_patrons_category.pl which allows for
updating patron categories in a batch upon meeting provided criteria.
This script additionally can replace j2a.pl.

To test:
1 - perl update_patrons_category.pl -h
2 - Ensure help text makes sense and covers all options
3 - Test converting patrons supplying only fromcat and tocat
    perl update_patrons_category.pl -f PT -t J -v --confirm
    perl update_patrons_category.pl -f J -t PT -v --confirm
4 - All patrons should have been switched to and from Juveniles
5 - Try without --confirm switch
    perl update_patrons_category.pl -f PT -t J -v
6 - Should list all patrons but not update
7 - Set the age for juvenile patrons to be outside the range provided in
categories (or set the upper age limit for juveniles to '2')
8 - Test with verbosity and with without --confirm
    perl update_patrons_category.pl -f J -a -t PT -v
    perl update_patrons_category.pl -f J -a -t PT -v --confirm
9 - Repeat above and verify linked/unlinked guarantors are removed in above scenario
10 - Test various fine and registration limits
11 - Test matching on specific fields i.e. --field surname=acosta
12 - Sign off

Sponsored by: Round Rock Public Library
(https://www.roundrocktexas.gov/departments/library/)
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:19:47 +01:00
14e5d38773
Bug 23579: (RM follow-up) Fix failing tests
Removing the default on changed_fields leads to the requirement for
tests to specify data to add to said field when mocking data.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:13:26 +01:00
37b2e05b29
Bug 23413: Fix tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 10:45:36 +01:00
9a9576dbd1
Bug 23805: Drop type lookup as it's now a foreign key
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:35:20 +01:00
5fbf423e94
Bug 23805: Update 'W' to 'WRITEOFF' for consistency
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:35:20 +01:00
6bfd41eb0a
Bug 23805: Update 'Pay' to 'PAYMENT' for consistency
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:35:20 +01:00
2665dc9094
Bug 23805: Update 'FOR' to 'FORGIVEN' for consistency
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:35:20 +01:00
b7900423a2
Bug 23805: Update accounttype references in tests
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:35:19 +01:00
962cebd484
Bug 23049: (QA follow-up) Explicitly set accounttype/debit_type in tests
This patch corrects an incorrect ternary and move the definitions into
the test_data array to clarify their intent.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:25:36 +01:00
24c0f30154
Bug 23049: (QA follow-up) Silence noisy warnings
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:25:33 +01:00
331c80d7b0
Bug 23049: (QA follow-up) Fix for missing types in test inserts
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:25:27 +01:00
a91f178d52
Bug 23049: (QA follow-up) ILSDI test data correction
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:25:24 +01:00
00970925ae
Bug 23049: (QA follow-up) Check constraint test corrections
TestBuilder adds random data which breaks the check constraint rule. The
simplest way to correct this situation is to override testbuilder by
passing in explicit undefs for accounttype or debit_type_code in the
tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:25:18 +01:00
9f13d9fb33
Bug 23049: (QA follow-up) Correction to patrons_accounts.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:25:12 +01:00
6d4ae2d47e
Bug 23049: Drop type lookup as it's now a foreign key
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:45 +01:00
af6464d05b
Bug 23049: Capitalise type passed to add_debit for overdue
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:39 +01:00
70268d49de
Bug 23049: Capitalise type passed to add_debit for lost_item
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:33 +01:00
56b38464bd
Bug 23049: Capitalise type passed to add_debit for account
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:27 +01:00
11bc809228
Bug 23049: Update 'PF' to 'PROCESSING' for consistency
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:24 +01:00
c97705d190
Bug 23049: Capitalise type passed to add_debit for rent
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:21 +01:00
950074fa7e
Bug 23049: Update debit_type_code 'Res' to 'RESERVE'
This patch updates all cases where debit_type_code was 'Res' to
'RESERVE' which is more informative and consistent with the new style
guidelines.

The patch also ensure all calls to add_debit with a type or 'reserve'
now pass the capitalised code instead.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:18 +01:00
d661141890
Bug 23049: Update existing code to use debit_type
* Update C4::Accounts::chargelostitem
* Update C4::Accounts::manualinvoice
* Update C4::Circulation::_FixOverduesOnReturn
* Update C4::Circulation::_FixAccountForLostAndReturned
* Update C4::Overdues::UpdateFine
* Update C4::Overdues::GetFine
* Update C4::Overdues::GetOverduesForBranch
* Update Koha::Account->pay
* Update Koha::Account->add_debit
* Update Koha::Account->non_issues_charges
* Update Koha::Account::Line->apply
* Update Koha::Account::Line->adjust
* Update controller scripts
* Update reports scripts
* Update tests

Test Plan
1) Run the test suit and ensure everything still passes
2) Test reports/cash_register_stats still works
3) Test that adding manual invoices still works
4) Test that making payments still works
5) Test that lost item fee handling still works
6) Test that invoice printing still works
7) Test that the sco still works

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:15 +01:00
8356c56cc2
Bug 23049: Add tests
Test plan:
  prove t/db_dependent/Koha/Account/DebitType.t
  prove t/db_dependent/Koha/Account/DebitTypes.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: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:11 +01:00
72e10519e3
Bug 23049: Add debit_type
* Add account_debit_types table
* Add ac_debit_types_branches table
* Add account_debit_types defaults
* Add Koha::Account::DebitType and Koha::Account::DebitTypes
* Prevent deletion of defaults
* Migrate MANUAL_INV values
* Remove MANUAL_INV references
* Migrate accounttype values

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:23:48 +01:00
48ec99e0fc
Bug 23152: Fix more pluralisation (and add tests)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:01:45 +01:00
1c34a54a0e
Bug 23413: Update tests to use build_sample_biblio
Before these changes the tests fail if run under Elasticsearch

This makes sure they pass either way

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 16:58:10 +01:00
d09083fc87
Bug 23392: Don't display private notes in MARC21
To test:
1 - Add some notes to a record in fields 541,542,561,583,590
2 - Ensure all of these are visible in the frameworks
3 - Note they appear in the 'Title notes'/'Description' tabs on OPAC/Staff client
4 - Mark first indicator '0' on all notes
5 - They still display
6 - Apply patch
7 - Notes no longer show on OPAC
8 - Notes still show on Staff client
9 - prove -v t/Biblio/GetMarcNotes.t

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 10:58:02 +01:00
ecf030b798
Bug 23843: Make funds endpoint tests more robust
Now that we use ->to_api all the object attributes are returned, so the
original tests that didn't follow the FKs would pass, and now they
don't. If there is no budget linked to the fund, it will return undef,
which is not accepted on the API (though it accepts not returning the
attribute).

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_funds.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-23 18:02:47 +01:00
99a1a6db0f
Bug 23793: Unit tests
This patch introduces full test coverage for the EmbedItems filter.

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Filter/EmbedItems.t
=> SUCCESS: Tests pass!
3. Sign off :-D
4. Use it to improve Koha!

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-23 17:33:09 +01:00
Ere Maijala
2b149c3d7a
Bug 13937: (follow-up) Fix searching with UTF-8 characters.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-23 15:01:44 +01:00
5555c9d460
Bug 22445: Replace %% with {}
Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-22 15:02:51 +01:00
03e4c0bf5d
Bug 22445: Add new pattern %normalized_isbn%
Quite bad to use C4::Koha from Koha::Biblio :-/

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-22 15:02:51 +01:00
e3b90c4cb9
Bug 22445: Allow marc fields as pattern
%tag$field%

There is a limitation here, only one replacement will work.
Let see if it is needed later to support several patterns

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-22 15:02:48 +01:00
3df15701d6
Bug 22445: Add tests for Koha::Biblio->custom_cover_image_url
Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-22 15:02:48 +01:00
1800a2e6b8
Bug 23770: (follow-up) Add tests for Koha::Objects->TO_JSON
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2019-10-21 10:04:11 +01:00
7ce5cb0865
Bug 23770: Unit tests
This patch introduces tests for the new to_api method introduced in
Koha::Object(s).

It uses Koha::City as a sample for simplicity. And it also uses
Koha::Illrequests to test the case in which there's no to_api_mapping
method defined on the class, to highlight that a fallback to calling
TO_JSON is done. [1]

[1] This is done under the assumption Illrequests controller code
doesn't use any kind of mapping as the rest of the API controllers do,
so there's little chance it would be added in a future.

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t \
           t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2019-10-21 10:03:59 +01:00
f5a3e4cbc9
Bug 23807: Unit tests
This patch introduces tests for the Koha::Item->as_marc_field method. It
tries to cover all the use cases.

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS; Tests pass!
3. Sign off :-D

Signed-off-by: Jan Kolator <kolatorj@email.cz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:06:23 +01:00
8870bc334b
Bug 23821: Remove new occurrence of create_helper_biblio
create_helper_biblio subroutines have been remove from bug 21798, but
one occurrence have been reintroduced by bug 7614. We must use
build_sample_biblio instead.

Test plan:
  prove t/db_dependent/Koha/Libraries.t
should return green.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 14:52:43 +01:00
480434bbf4
Bug 23129: (RM follow-up) Fix failing test
This patch corrects a test that was testing for the oposite behaviour to
that introduced in this patchset.  We have agreed on the bug that the
new behaviour is desired and so I have updated the test to follow.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-15 16:50:50 +01:00
77884d6c76
Bug 23038: Remove unused stderr vars
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-15 14:14:13 +01:00
04ec6627e2
Bug 23038: Hide expected warnings from tests
When tests are ran, there are 2 warnings that are expected and raised by
DBI.
As they are expected they must be correctly caught and not displayed.

We could have reconnect with PrintError turned off, but then reconnect
with it on.

Test plan:
% prove t/db_dependent/Circulation/MarkIssueReturned.t t/db_dependent/Suggestions.t
Must not display DBI warnings

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-15 14:14:01 +01:00
61aa04e6cb
Bug 23129: Unit test
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-15 14:12:49 +01:00
Ere Maijala
19fbc1cfa2
Bug 13937: (QA follow-up) Make tests work with YAZ 4 and 5.
Also makes add_item_status tests more robust by clearing the cache after modifying authorised values.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-15 09:50:04 +01:00
Ere Maijala
afb5796b34
Bug 13937: (QA follow-up) Fix tests.
Checking result set size is enough to verify that proper results were returned. The check for non-existing record could have caused a range error depending of library versions.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-14 13:46:50 +01:00
Colin Campbell
870f25fbd9
Bug 21580: Add test for message buyer_ean method
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-10 08:23:04 +01:00
15a30c129c
Bug 20334: (RM follow-up) Fix test for case insensative filesystems 2
This patch moves the Elasticsearch/Indexer.t to ElasticSearch/Indexer.t
and thus removes the case directory name collision introduced.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-09 15:07:29 +01:00
104436cb74
Bug 20334: (RM follow-up) Fix test for case insensative filesystems
This patch moved the tests created in Elasticsearch/QueryBuilder.t into
ElasticSearch/QueryBuilder.t and thus removes the case directory name
collision introduced.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-09 15:04:24 +01:00
ce8896f17d
Bug 22997: Unit test
Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-09 14:29:14 +01:00
Katrin Fischer
30627be138
Bug 23697: (QA follow-up) Rename PatronAutocompletion to PatronAutoComplete
Just a find and replace on the changed system preference name.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:51:12 +01:00
Matthias Meusburger
e5bf671357
Bug 23697: (follow-up) Add autocompletion search in patron module
- Rename CircAutocompl system preference to PatronAutocompletion
 - Take this system preference into consideration for patron search

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:51:04 +01:00
Ere Maijala
300a7a8110
Bug 13937: Add SRU tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:40:21 +01:00
Ere Maijala
9fb7f01f00
Bug 13937: Fix RPN conversion
Fixes handling of parenthesis and removes unused quote handling.

Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:40:00 +01:00
Ere Maijala
fe59ab8165
Bug 13937: Add tests for search and retrieval
Sponsored-by: National Library of Finland
Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:39:57 +01:00
Ere Maijala
925db0baef
Bug 13937: Fix issues found in QA
Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:39:50 +01:00
67d798fc9e
Bug 13937: Add unit tests
Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:39:43 +01:00
24245e2aef
Bug 17005: Test for checked_in parameter
Test plan:
prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:33:39 +01:00
ea59b648f1
Bug 23677: Unit tests
This patch introduces tests for the GET /biblios/{biblio_id} endpoint.
It tries to cover all the use cases.

To test:
- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
- Use Postman (or your favourite tool) to test the API
=> SUCCESS: Works as expected!
- Sign off :-D

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:33:34 +01:00
David Gustafsson
da16f6bc91
Bug 20334: Option for escaping slashes in search queries
Add "QueryRegexEscapeOption" system preference to provide option to escape
Elasticsearch regexp delimiters (/) within queries, or alternativly to
unescape escaped slashes (\/) while escaping unescaped slashes, in
effect making "\/" the new regexp delimiter.

How to test:
1) Run tests in ./t/Koha/SearchEngine/ElasticSearch/QueryBuilder.t
2) All tests should succeed

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:09:53 +01:00
Katrin Fischer
018bcce2f7
Bug 14669: Add search option for managing library to orders search
Currently the order search can't be limited by managing library.
The patch adds the search option to the order history search form
and a column for the managing library to the search results table.

To test:
- Create some baskets with orders
  - Set managing library for some, but also have some without
- Apply patch
- prove t/db_dependent/Acquisition.t
- Go to Aquisition > Orders search tab on top > Advanced search link
- Search for orders without limiting
  Orders with and without managing library set should show up
- Limit search to a specific managing library
- Verify results match expectations

Signed-off-by: Alex Sassmannshausen <alex@komputilo.eu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:04:48 +01:00
7c97f5263d
Bug 23389: Add 'All' option to report dropdowns
This patch optionally adds an 'all' option to report dropdowns

Note you will need to use 'LIKE' instead of '=' to allow 'All' to work

To test:
 1 - Write a report:
     SELECT branchname FROM branches WHERE branchcode LIKE <<Branch|branches>>
 2 - Run it
 3 - Select a branch
 4 - You get one branch info
 5 - Note you cannot select all
 6 - Apply patch
 7 - Run report
 8 - No change
 9 - Update report like:
     SELECT branchname FROM branches WHERE branchcode LIKE <<Branch|branches:all>>
10 - Run report
11 - Select 'All'
12 - You get all branches
13 - Select one branch
14 - You get one branch
15 - Test with other authorised categories (itemtypes, YES_NO, etc.)
16 - Confirm it works as expected
17 - Prove -v t/db_dependent/Reports/Guided.t

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-07 14:09:10 +01:00
8b97be3671
Bug 23039: (RM follow-up) Fix basic_workflow test
This bug altered the markup of the returns page subtly, introducing a
new div level and as such changing the required xpath expression for the
checkin submission button in the basic_workflow tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-07 14:09:10 +01:00
Agustin Moyano
a3ec118dd9
Bug 23710: (follow-up) Add tests for new features in Koha::REST::V!::Holds::add and return error when hold date in future is not allowed and it is passed as parameter
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-07 13:00:17 +01:00
5c76ad78a3
Bug 18084: (RM follow-up) Fix authentication tests
A change to the way we hide/expose the user menu in the opac resulted in
the authentication selenium tests failing. This was due to the logout
button being identified as hidden under the new code and as such the
logout action not being triggered correctly between each login test. The
was was simply to add an additonal 'click' event called on the menu
button to put the logout link into the visible viewport.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-07 12:10:54 +01:00
1175b9fb87
Bug 20589: (follow-up) Fix tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-03 16:00:10 +01:00
3de3269d92
Bug 20589: (RM follow-up) Fix Koha::SearchField.t
This patch removes the unit test for the weighted_fields method which
this bug removed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-03 14:17:32 +01:00
b63b55cda7
Bug 21985: Fix further occurences
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-03 10:26:33 +01:00
95a2ffc542
Bug 21985: Trying to fix the next failure
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-03 10:26:28 +01:00
18f9ed465d
Bug 21985: Fix Circulation tests when ES it set, by using build_sample_item
We should use build_sample item (from bug 21971) to create items,
otherwise we may not have a valid biblioitem and/or MARC record.

Test plan:
Set SearchEngine to ES
prove that the tests in Circulation.t now pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-03 10:26:22 +01:00
ab54b5458d
Bug 20589: Remove expanded_facet variable and fix tests
Thi is a rebase from 14419 to remove an unused variable

Also update tests to expect the new expected result

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-02 13:29:47 +01:00