Commit graph

3610 commits

Author SHA1 Message Date
Katrin Fischer
401e8e791e Bug 22478: Fix POD
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-02 13:40:26 +00:00
3b12416dc8 Bug 22478: Add tests
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-02 13:40:26 +00:00
0fb9b9fdb0 Bug 22478: (RMaint follow-up) source t::lib::Mocks
In 18.11.x the t::lib::Mocks module is not yet sourced for the relevant
test

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-02 13:40:26 +00:00
05f22c2159 Bug 22692: (RM follow-up) Adjust test count
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-02 13:40:07 +00:00
30de51fa0c Bug 22692: Unit tests
1 - Apply just this patch
2 - prove -v t/db_dependent/Auth.t
3 - Failure
4 - Apply second patch
5 - prove -v t/db_dependent/Auth.t
6 - Success

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-02 13:39:06 +00:00
7687151605 Bug 8995: (QA follow-up) Mock required sysprefs in the tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-30 14:44:44 +00:00
d0e6a26558 Bug 21364: (follow-up) Check for standing status and uncertain prices
Fetch 'uncertainprices' when getting basket info. A side effect is that styling on baskets with uncertain prices is restored by this bug. They will appear in red

To test:
1 - Add an order with an uncertainprice to the basket
2 - Return to vendor baskets view
3 - Note the actions now include "Uncertain prices"
4 - Click that, resolve the uncertain prcie
5 - Return to vendor basket view
6 - Note you can now close the basket, but don't
7 - Edit the basket, mark it as standing
8 - Return to vendor basket view
9 - Note you cannot close the basket

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-30 12:45:42 +00:00
7a44c9edb9 Bug 22010: Check preferences for ebook integration
To test:
1 - Enable OverDrive and RecordedBooks (you can put anything in the
        prefs)
2 - Search on the opac - verify you get results (or search error) on
first page of results'
3 - Go to second page of results - OD and RB are not searched
4 - Apply patch
5 - Verify nothing has changed

If you have valid credentials:
1 - Enable RB prefs
2 - Sign in with an account that has an email matching your registered
account for recordedbooks
3 - Confirm you RB account loads on opac-user.pl

Otherwise:
Read the patches, verify it all makes sense

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-30 11:42:51 +00:00
e5dbc76fff Bug 8995: DBRev 18.12.00.066
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-29 16:09:00 +00:00
d99d32d033 Bug 8995: (follow-up) Add tests, move open_url/coins routines to Koha namespace
Test plan:
1) Ensure the COinS span tag is still included on this pages. You need
to look into html source and search for span tag with class 'Z3988',
   which has COinS string in title.
   Staff client:
       catalogue -> ISBDdetail
       catalogue -> MARCdetail
       catalogue -> detail
       virtualshelves -> shelves
    OPAC (you should have COinSinOPACResults system preference enabled):
        opac detail
        opac search
        opac shelves
2) Run tests:
prove t/Biblio.t t/db_dependent/Biblio.t t/db_dependent/Koha/Biblio.t

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested with all 9 current patches. Works as advertised, including
OPACURLOpenInNewWindow. If a record has no items, no OpenURL link
is displayed. All the suggested tests pass. I did not test with
XSLT turned off.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-29 15:34:10 +00:00
c5a98ed3e1 Bug 8000: (QA follow-up) Two lastminute fixes
[1] Number of tests Letters.t
[2] Resolving uninitialized warn on Letters, L1327

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-29 15:08:47 +00:00
David Bourgault
d51054c8b4 Bug 8000: Redirect all emails to SendAllEmailsTo
Rebased and squashed after changes to master.
Only difference from previous patches are small adjustements to conflicts in t/db_dependent/Letters.t

Test plan:

1) Apply path
2) Run updatedatabase.pl
3) Clear all SendAllEmailsTo system preference
4) Send mail to a patron of your choosing, email will go to patron's
   email address as usual.
5) Set SendAllEmailsTo to a test email address
6) Send mail to the patron, email will be redirected to the email set
   in the systempreference.
7) Run prove -v t/db_dependent/Letters.t

It does not affect messages in the message_queue.

This patch obsoletes previous patches, because it achieves the same
functionality in a much more centralized way. (4 lines of code!)

Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Signed-off-by: BWS Sandboxes <ByWaterSandboxes@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-29 15:08:46 +00:00
5a63c5baa2 Bug 15496: (QA follow-up) Fix remaining cases
This patch fixes remaining cases of the list => scalar change.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/Holds/HoldFulfillmentPolicy.t t/db_dependent/Reserves.t
=> FAIL: Tests fail
- Apply this patch
- Run:
 k$ prove t/db_dependent/Holds/HoldFulfillmentPolicy.t t/db_dependent/Reserves.t
=> SUCCESS: Tests pass
- Sign off :-D

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-04-26 17:52:53 +00:00
bfce1fea96 Bug 15496: (QA follow-up) Fix new uses of Koha::Biblio::items in list context
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-26 12:07:04 +00:00
5743bb2945 Bug 15496: (QA follow-up) Change success status on api
DELETE response code must be 204, not 200 according to our API coding
guidelines

Test plan:

prove t/db_dependent/api/v1/biblios.t

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-04-26 12:06:58 +00:00
2b45630e42 Bug 15496: Add API endoint for deleting a bib
Signed-off-by: Liz Rea <wizzyrea@gmail.com>

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-04-26 10:54:49 +00:00
f82d6acab6 Bug 22200: Add Tests for change
Unit tests to check for the addition of a credit of type 'FOR' when
_FixOverduesOnReturn is called with $exemptfine set to true.

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-04-26 10:28:48 +00:00
90a15e2d82 Bug 20837: (RM follow-up) fix test count
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-25 14:25:06 +00:00
62b6d94daa Bug 14576: Rebase fixes Fix test Rebase code
Signed-off-by: Liz Rea <wizzyrea@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-25 11:36:24 +00:00
152e89b711 Bug 14576: Unit tests
To test:
1 - prove -v t/db_dependent/Circulation/Returns.t
2 - prove -v t/db_dependent/Circulation/issue.t
3 - prove -v t/db_dependent/UsageStats.t
4 - All should pass

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-25 11:36:24 +00:00
58195734ee Bug 22511: (follow-up) Fix test plans
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-04-25 11:02:14 +00:00
0db7b7a1c8 Bug 22511: Update tests
Updated tests to check for 'status' change and fixed 'accounttype' and
moved from t/db_dependent/Accounts.t to the more appropriate
t/db_dependent/Koha/Account/Lines.t

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-04-25 11:02:14 +00:00
Ere Maijala
aba8b130f8 Bug 22413: Improve query string and desc creation for Elasticsearch
Test plan:

After each of the following steps, verify that the results and query description looks ok.

1. Do a simple keyword query
2. Change sort order
3. Click a facet
4. Do an advanced search with title and author
5. Change sort order
6. Click a facet

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

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-25 10:38:17 +00:00
Ere Maijala
0047ede37e Bug 22339: Fix search field mappings of MARC fixed fields
Fixes handling of /0 selector in addition to several fixed field positions. Note that ff7-01-02 is in fact 00-01 in Zebra and that has been replicated here.

Test plan:
1. Before applying a patch, check from Elasticsearch (e.g. localhost:9200/koha_biblios/_search?q=_id:123) what is indexed in Elasticsearch for a record for date-entered-on-file, ff7-00, ff7-01, ff7-02 and lleader.
2. Apply the patch, update database and save the record again.
3. Verify that the contents of the forementioned fields is now correct in Elasticsearch.
4. Verify that tests pass:  prove -v t/Koha/SearchEngine/Elasticsearch.t

Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-25 10:32:09 +00:00
28e536892a Bug 20837: Unit tests
To test:
prove -v t/db_dependent/Holds.t
prove -v t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-25 10:26:21 +00:00
5854e5de7f Bug 22729: Adapt Koha::Patron(s) and tests
This patch adapts the Koha::Patron(s) code to the column change.
To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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-04-25 10:06:44 +00:00
6416ead3cb Bug 22701: Unit tests for Koha::Biblio->items
This patch adds tests fr the current items() implementation. The idea is
to verify no behaviour change takes place after we make it us
_new_from_dbic instead of calling Koha::Items->search.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Biblio.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-04-24 10:56:33 +00:00
e3b6841437 Bug 22694: Unit tests
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-24 10:51:26 +00:00
6f4565ce68 Bug 22749: Regression tests for Koha::Item->hidden_in_opac
This patch introduces regression tests for Koha::Item->hidden_in_opac to
verify it is not considering the hidelostitems syspref when determining
if an item should be hidden (per policy) in the OPAC.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Item.t
=> FAIL: Tests fail!

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-04-24 10:39:55 +00:00
d8a759162c Bug 22679: Delete related CirculationRules when Removing IssuingRule
Unfortunately, the tables here can't use a foreign key as one table uses null where the other uses
'*' This patchset alters the delete method so delete related rules. It is somewhat of a workaround until
all the columns in issuingrules are moved to circulation_rules

To test:
1 - Add some issuing rules in koha, making sure to set maxissueqty
2 - Check the DB: SELECT * FROM circulation_rules;
3 - note some circulation rules were created
4 - Delete your rules via the staff interface
5 - Check the DB, the circulation rules remain
6 - Apply patch
7 - Repeat
8 - Huzzah! The rules delete!
9 - Prove the tests, read the code

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-24 10:35:38 +00:00
6d9839d800 Bug 22759: Unit tests
To test:
1 - Apply only this patch
2 - prove -v t/db_dependent/Circulation/TooMany.t
3 - It fails
4 - Apply second path
5 - repeat
6 - All green!

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-24 10:35:02 +00:00
f751423d15 Bug 16149: Unit tests
To test:
prove -v t/db_dependent/Reports/Guided.t

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Jessica Ofsa <jofsa@vt.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-19 14:37:32 +00:00
7262bc0667 Bug 21937: Add test to show autoBarcode annual increment bug
This patch show the issue. If the DB contains a barcode (not auto attributed
by Koha) which begin with the year used to generate automatically a new one,
there may be a 'collision'.

prove -v t/db_dependent/Barcodes_ValueBuilder.t

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-04-19 14:32:17 +00:00
170085397b Bug 15505: Mark Hold Items 'On hold' instead of 'Available'
This patch adds a 'pending hold' column to C4::Items:GetItemsInfo to
allow for displaying status of an item when it has been selected for a
hold by the holdsqueue and AllowItemsOnHoldCheckout is set to 'Don't
allow'

To test:
00 - Set AllowItemsOnHoldCheckout to 'Allow'
01 - Place a hold on an item
02 - Build the holdsqueue (kohadevbox example below)
      sudo koha-shell kohadev
      perl misc/cronjobs/holds/build_holds_queue.pl
03 - Search for the item on the OPAC
04 - Note item shows as 'Available' in results and details
05 - Toggle AllowItemsOnHOldCheckout to 'Don't allow'
06 - Repeat search, note there is no change
06 - Apply Patch
07 - Search for the item on the OPAC
08 - Note that item now shows as 'Pending hold'
09 - Toggle AllowItemsOnHoldCheckout to Allow
10 - Note item shows as available
11 - prove -v t/db_dependent/Items.t

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-19 14:30:39 +00:00
bc3f6a6aac Bug 22521: (RM follow-up) Adjust tests to use new accounttype
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-18 10:48:10 +00:00
e600ae6c4b Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker
To test:
1 - prove -v t/db_dependent/Biblio.t
2 - Set BiblioAddsAuthoorities and AutoCreateAuthorities
3 - Modify a biblio to add a heading with no existing auth record
4 - Ensure the record was created on saving
5 - Ensure that editing works as normal otherwise
6 - Run link_bibs_to_authorities
7 - Ensure results are as expected

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-04-18 10:02:03 +00:00
da8ca6c865 Bug 21336: Fix the API
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-18 09:49:57 +00:00
fa92232203 Bug 22521: (QA follow-up) Update number of tests in Circulation.t
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-17 16:50:41 +00:00
855ecd9f6e Bug 22521: (QA follow-up) Update 'Offsets' test
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-04-17 16:49:36 +00:00
a6ba3bcc0d Bug 22521: (QA follow-up) Corrections to tests
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-04-17 16:49:36 +00:00
dc62187ebf Bug 22521: Update fines handling to use accountline.status
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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-04-17 16:49:36 +00:00
97a680cc24 Bug 22547: Add tests for C4::Overdues->UpdateFine
Add tests for UpdateFine, in particular testing the functionality of
MaxFine.

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

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-04-17 16:49:33 +00:00
4c01891613 Bug 20128: (QA follow-up) Corrections to haspermission
The haspermission routine wrongly assumed that get_user_subpermissions
would return a list of all subpermissions if the user had the top level
permission, but instead if just returns 1.

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-04-17 12:25:26 +00:00
8f8367c728 Bug 20128: Problem when checking individual perms where borrower has top level
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-17 12:25:26 +00:00
cd082782d1 Bug 17171: Add a syspref to allow currently issued items to be issued to a new patron without staff confirmation
Some libraries don't want to force the librarians to manually confirm
each checkout when the item is checked out to another. Instead, they
would prefer to be alerted after the fact.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Enable the new syspref AutoReturnCheckedOutItems
4) Check an item out to a patron
5) Check the same item out to another patron
6) Note you are not prompted to confirm the checkout,
   but are instead alerted that is had been checked out to another patron!

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: BWS Sandboxes <ByWaterSandboxes@gmail.com>

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

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-17 12:25:25 +00:00
d86f17e6b8 Bug 21336: (QA follow-up) Add tests for administrative lockout
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-17 12:25:24 +00:00
f7f5f167e5 Bug 21336: Search, lock and anonymize methods
Add Koha::Patron->lock and anonymize.
Add Koha::Patrons methods search_unsubscribed, search_anonymize_candidates
and search_anonymized. And wrappers for lock and anonymize.
Add unit tests.

Test plan:
Run t/db_dependent/Koha/Patrons.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-04-17 12:25:24 +00:00
0611621ed0 Bug 21336: Introduce administrative lockout
As a preparation for Koha::Patron->lock, we add the concept of administrative
lockout. The account is locked just as it would have been by too much
failed login attempts.
This is handled by a negative value in borrowers.login_attempts.

Test plan:
Run t/db_dependent/Auth.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-04-17 12:25:23 +00:00
71f17b35ee Bug 21336: Do not increase login_attempts after locking
If an account has been locked, there is no use to keep increasing this
number. It is not true too; after the pref number has been reached,
we can not really speak of login attempts anymore. The credentials are
just ignored.

Adding a dbrev to put existing values in line. And a simple test in
Auth.t to confirm that login_attempts stop increasing.

Note: It feels safe to keep the '>=' condition in account_locked. But it
could obviously be changed to '=='. (Added a test for that.)

Note: Adding a mock_preference in Auth.t too for GDPR_Policy. Since not all
tests will pass when the pref is enabled (though disabled by default).

Test plan:
Run dbrev with updatedatabase.pl.
Run t/db_dependent/Koha/Patrons.t
Run t/db_dependent/Auth.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-04-17 12:25:23 +00:00
0be8fd2120 Bug 21975: add Unit Test
Added missing transaction rollback

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-04-16 13:17:33 +00:00