Commit Graph

5105 Commits

Author SHA1 Message Date
Nick Clemens a35d26490a Bug 30540: Fix perl critic complaint of leading zeros
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8cc4961143)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit f1641e96b2)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-05-09 23:52:22 +02:00
Martin Renvoize ef14fdb18b Bug 30540: Unit test
This patch adds tests for checking the output_pref method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/DateUtils.t
=> FAIL: The feature is not implemented, tests fail to complete

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 052dd948af)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 3e42ca76c2)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-05-09 23:51:47 +02:00
Martin Renvoize 7dfd5a74bc Bug 30518: Unit test
This patch adds tests for checking the needs_advancing method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/db_dependent/StockRotationItems.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4450ad2110)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit b8c1391c4a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-05-09 23:46:16 +02:00
Mason James 476b64fd2d Bug 19169: Add a test to detect unneeded 'atomicupdate' files
to test...

1/ set git repo
    $ git reset --hard v21.11.03

2/ run test
    $ prove ./t
    OK

3/ apply patch

4/ run test again, observe FAIL

    $ prove ./t/00-check-atomic-updates.pl
    ./t/00-check-atomic-updates.pl .. 1/?
    #   Failed test 'check for unhandled atomic updates: bug_29596.pl'
    #   at ./t/00-check-atomic-updates.pl line 34.
    #                   'bug_29596.pl'
    #           matches '(?^u:.*pl$)'
    # Looks like you failed 1 test of 3.
    ./t/00-check-atomic-updates.pl .. Dubious, test returned 1 (wstat 256, 0x100)
    Failed 1/3 subtests

JD Amended patch: fix copyright year
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1d24015e46)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit bc831c17ad)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-04-25 22:52:25 +02:00
Jonathan Druart 08a0e5925b Bug 26328: Add test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 68664b7b70)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 2a290b36a7)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-04-17 22:19:07 +02:00
Marcel de Rooy 1074768769 Bug 28943: Lower the risk of accidental patron deletion
If you do not use a temporary self registration patron category,
you should actually make the preference
PatronSelfRegistrationExpireTemporaryAccountsDelay empty.

As the comment in sysprefs.sql already said, we should not let
a zero value in the pref delete patrons too.

The module is changed now, the test adjusted and
the description of both related sysprefs modified.

Test plan:
Run t/db_dependent/Members.t
Check in Administration the two adjusted OPAC pref descriptions.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8e500c57da)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 7730699767)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-04-17 22:03:05 +02:00
Nick Clemens 4fa543c6ab Bug 22993: Unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c5577fa6ba)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit bb9cf28aa2)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-03-28 11:45:15 +02:00
Tomas Cohen Arazi 2fa43197c1 Bug 29877: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8ea1b883b7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 998e0997e4)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-03-18 03:34:35 +01:00
Tomas Cohen Arazi 97a59bd8d3 Bug 29754: (QA follow-up) Minor tests tweaks
This patch does two things:

- Wraps the new SIP tests in a single transaction. We do that to avoid
  sub-test interference, specially when test files get big. The provided
  tests are correct and don't require previous tests data.
- Migrated from the introduced 'diag' calls to 'note', as I just learned
  they are the same, but 'note' is only displayed when in verbose mode.
  Which is great to avoid unnecessary noise in Jenkins.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0f0bfcad7c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 190c925997)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-03-18 01:00:21 +01:00
Nick Clemens 487eddaf1e Bug 29754: Unit test
This adds a unit test to the SIP code

It also adds some spacing and dividers to make the tests for 'relationships_debt' easier to read

To test:
prove -v t/db_dependent/Koha/Patron.t - passes and is readable
prove -v t/db_dependent/SIP/Patron.t - fails

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a38ba3b0bd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 1058a16e87)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-03-18 00:59:16 +01:00
Jonathan Druart d7e2701415 Bug 29862: Add missing txn begin/rollback in TestBuilder.t
It fixes the tests when SearchEngine=ES
 t/db_dependent/TestBuilder.t .. 7/15 Invalid MARC field expression: l5ffglZ_upqqcwOvaiyALgXfyJw2Ot2AGRPUsiAPzSFHfd8J_hsnuQ8z75B8RKc_kyo2rFBp8BrPNwcM1FPhc01ngP01HU_Z7Rx1VHfcIcmrifYnjBDWNmYB9N5_4xEnxMH7ZhqC9b2Bz9wf9
 wSEmx64x6t5xFFKX at /kohadevbox/koha/C4/Biblio.pm line 306.
     # Looks like you planned 12 tests but ran 6.

 #   Failed test 'Tests for delete method'
 #   at t/db_dependent/TestBuilder.t line 302.
 Can't call method "biblionumber" on an undefined value at t/db_dependent/TestBuilder.t line 281.
 # Looks like your test exited with 11 just after 8.

Previous subtest created invalid date in the ES mappings.

Test plan:
Set SearchEngine=ES and run the tests, they must pass.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 27ec3a5d4c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 6c206df70a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-24 23:34:10 +01:00
Jonathan Druart 179fb6f6af Bug 29495: Fix TestBuilder.t
Value not allowed for auto_incr issue_id in Issue at /kohadevbox/koha/t/lib/TestBuilder.pm line 387.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 0e369364a3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-23 22:47:12 +01:00
Martin Renvoize f10783a84c Bug 29495: Unit Tests
Test plan
1. Run updated tests prior to applying new patches.. pass
2. Run updated tests after applying new patches.. pass

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit a052d6752c)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-23 17:46:48 +01:00
Andrew Isherwood 74c62427dc Bug 28932: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit cbac005968)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 8a1f2fb600)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-18 21:59:30 +01:00
Martin Renvoize 5cba34bb76 Bug 29670: Unit tests
This patch adds unit tests for Koha::Edifact::Order->order_line. We now
check that the message segments are created as expected for both the
'ordering' and not 'ordering' case for acquisitions item creation time.

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

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

JD amended patch: spelling segement ==> segment

(cherry picked from commit 67bb6f7b95)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 1926a20753)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-12 20:46:33 +01:00
Tomas Cohen Arazi cdca6f73d5 Bug 29736: (QA follow-up) No need to delete all clubs
There's no real need to delete all the existing clubs in the tests.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d4c628f171)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4e4a452609)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-11 23:02:56 +01:00
Jonathan Druart 8691aae755 Bug 29736: Don't return empty clubs
There is an error when placing a hold for a club without members:
Uncaught TypeError: err.responseJSON.error is undefined

It seems that we should remove clubs without members from the search.

Test plan:
Create 1 club xx with 2 patrons
Create 1 club xxx with 1 patron and cancel their enrolment
Create 1 club xxxx without patron

Place a hold for club "x", only the first one should be returned with
this patch.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b45e67e03e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4520178095)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-11 23:02:01 +01:00
Tomas Cohen Arazi c16e8c8174 Bug 29018: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 493db07948)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-07 19:50:20 +01:00
Jonathan Druart feed7892a8 Bug 29696: Add tests
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 146c1e1d9f)

Bug 29696: correct number of tests for 21.05.x

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit c467f3faca)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-02-07 01:17:52 +01:00
Jonathan Druart 3afe1ccb6d Bug 29914: Remove 'Use of uninitialized value ' warnings
(cherry picked from commit 68c11c5179)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 19:15:45 +01:00
Nick Clemens 8c52a17ef2 Bug 29914: (QA follow-up) Expand tests to cover failure case before patches
When asking for permissions we get 'failed', without we get 'ok'
Adding explicit checks for not 'ok'

Add a FIXME:
We should cover the case where we return 'failed' after changes, but that is a larger undertaking

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e956130f8f)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 19:15:45 +01:00
Marcel de Rooy 862836954b Bug 29914: Remove warn on timeout
The value of the system preference 'timeout' is not correct, defaulting to 600.

Caused by previous test. Actually an omission in another sub that
does not seem to support 10x.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit eea32e6c5d)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 19:15:45 +01:00
Jonathan Druart 2189647bb0 Bug 29914: Add tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3af901ae64)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 19:15:45 +01:00
Jonathan Druart 37f1af8a19 Bug 29543: Add JWT token handling
Mojo::JWT is installed already, it's not a new dependency.
We need a way to send the patron a token when it's correctly logged in,
and not assumed it's logged in only if patronid is passed

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d978bf1506)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 19:15:44 +01:00
Marcel de Rooy b8418ee1a9 Bug 29437: (QA follow-up) Update TODO in Breeding.t
We now have some tests for BreedingSearch.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0b428c36db)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 01:09:39 +01:00
Nick Clemens ac4c5b3eaa Bug 29437: Unit tests
Signed-off-by: David Nind <david@davidnind.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4c2fc8eac5)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 01:09:39 +01:00
Nick Clemens f2ccbd4f08 Bug 29284: Unit test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit fa56c8b069)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 00:45:57 +01:00
Martin Renvoize fc229c123e Bug 28316: (QA follow-up) Make clean_search_term public
With all the work that's gone into improving the internal
_clean_search_term method I feel we should expose it publically as it's
going to be more widely helpful

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 641e8e4096)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 00:44:32 +01:00
Petro Vashchuk ec6b3f7091 Bug 28316: add tests
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 405812b407)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-01-31 00:44:32 +01:00
Victor Grousset/tuxayo ce1a2f9159 Bug 28316: REVERT ALL: due to string freeze
The follow-up bug 29284 introduces a new string.
Both patchsets will be backported for next release.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-12-22 20:50:43 +01:00
Victor Grousset/tuxayo cbe0d35757 Bug 29284: REVERT ALL: due to string freeze
Will be backported for next release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-12-22 20:50:38 +01:00
Nick Clemens 350e60c99e Bug 29284: Unit test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit fa56c8b069)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-12-22 20:21:55 +01:00
Martin Renvoize 4d0232ce72 Bug 28316: (QA follow-up) Make clean_search_term public
With all the work that's gone into improving the internal
_clean_search_term method I feel we should expose it publically as it's
going to be more widely helpful

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 641e8e4096)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-12-22 19:55:22 +01:00
Petro Vashchuk 25024d8438 Bug 28316: add tests
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 405812b407)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-12-22 19:55:22 +01:00
Tomas Cohen Arazi 3ad75ad185 Bug 29330: Add Koha::Email->new_from_string
This patch introduces a new method to Koha::Email. This method allows us
to parse a MIME email to initialize the Koha::Email object. This is
particularly important when we are restoring emails from the DB. i.e.
from the *message_queue* table.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> SUCCESS: Tests pass! Koha::Email->new_from_string is the correct
counterpart for Koha::Email->as_string!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2d6a189e89)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-12-19 21:15:44 +01:00
Martin Renvoize 2712dbeca6 Bug 28803: Add unit tests
This patch updates Letters.t to confirm that invalid email addresses in
the message_queue should not throw an exception when sending mail but
instead set the status to failed and pass error details to the end user.

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

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-24 15:09:42 -10:00
Fridolin Somers 1c768b1c99 28870: (20.11.x) fix UT on SendQueuedMessages
Taken from Bug 28803 :
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125345&action=diff#a/t/db_dependent/Letters.t_sec1
2021-11-24 14:50:53 -10:00
Jonathan Druart 72bf96f641 Bug 28870: non-FQDN addresses are valid
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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8883409e0a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-19 10:41:49 -10:00
Jonathan Druart c443bf11a0 Bug 28870: Move email address validation to a specific class method
To ease testing and future changes if needed.

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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6d5a0bd832)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-19 10:41:49 -10:00
Tomas Cohen Arazi 712d949b12 Bug 28870: Regression tests
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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e6ff06d263)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-19 10:41:49 -10:00
Joonas Kylmälä c60cdb9bfc Bug 27708: (QA follow-up) Add a few tests for Koha::Edifact::Order
1. This adds a simple regression test to make sure order_line() method
executes correctly with basket create_items set to "ordering" and
"receiving".

2. A simple test for the filename method is added

To test:
 1) prove t/db_dependent/Koha/Edifact/Order.t

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

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

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8c1ea4ec8a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-12 13:15:24 -10:00
Marcel de Rooy 03de9b36bb Bug 27173: Add tests
Test plan:
Run t/db_dependent/Koha/Plugins/authority_hooks.t

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b0a570a856)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-12 12:36:24 -10:00
Fridolin Somers d1daaf7f87 Bug 28365: Add unit test
Run prove t/db_dependent/Search.t

Without fix you get error :
    #   Failed test 'buildQuery should keep 0 value in query_cgi'
    #   at t/db_dependent/Search.t line 670.
    #          got: 'idx=su%2Cphr'
    #     expected: 'idx=su%2Cphr&q=0'

This patch also adds a test for query_desc in case it is broken in the
future.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ae66b6f175)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-10 15:46:17 -10:00
Martin Renvoize 52f70b9b9f Bug 28729: Unit tests
Signed-off-by: David Nind <david@davidnind.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b942d13714)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-10 15:43:10 -10:00
David Gustafsson 8407c79378 Bug 27884: Add tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit cd5c1be348)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-10 15:38:19 -10:00
Jonathan Druart 7e110c9172 Bug 29350: Don't need to escape the 'delete' TT methods
Will be needed by bug 22605.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f99366a54e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-10 15:18:13 -10:00
Jonathan Druart 38dae21f32 Bug 29364: Revert changes to framework visibility made by Search.t
To recreate run:

drop database koha_kohadev;
create database koha_kohadev;

restart_all

KOHA_TESTING=1 prove t/db_dependent/selenium/01-installation.t t/db_dependent/Search.t t/db_dependent/Koha/UI/Form/Builder/Item.t
        #   Failed test 'Item types should be sorted by description and an empty entries should be shown'
        #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 127.
        #     Structures begin differing at:
        #          $got = undef
        #     $expected = ARRAY(0x557716b68e98)
        # Itemtypes details: $VAR1 = undef;
        # $VAR2 = [
        #           'BK',
        #           'CF',
        #           'CR',
        #           'ihxGmo7',
        #           'MP',
        #           'MU',
        #           'MX',
        #           'REF',
        #           'VM'
        #         ];

        #   Failed test 'Labels should be correctly displayed'
        #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 130.
        #     Structures begin differing at:
        #          $got = undef
        #     $expected = HASH(0x557716e2e150)
        # Looks like you failed 2 tests of 2.

    #   Failed test 'itemtypes'
    #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 133.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 21347f064d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-10 14:11:30 -10:00
Jonathan Druart f5d708bf3c Bug 29363: Fix TestBuilder.t if bib 123 does not exist
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 70acf7157c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-10 14:10:17 -10:00
Jonathan Druart fe339d0d28 Bug 29315: Remove warnings from Search.t
The syspref SearchLimitLibrary was requested but I don't know what to
say; this indicates that the test requires updating at
t/db_dependent/Search.t line 198.
The syspref FacetOrder was requested but I don't know what to say; this
indicates that the test requires updating at t/db_dependent/Search.t
line 198.
The syspref OPACResultsUnavailableGroupingBy was requested but I don't
know what to say; this indicates that the test requires updating at
t/db_dependent/Search.t line 198.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8ef4cb8cb3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-10 13:40:23 -10:00
Marcel de Rooy 59e3e9ae64 Bug 29306: Fix warning on undefined $_ in Holds.t
Use of uninitialized value $_ in concatenation (.) or string at t/db_dependent/Holds.t line 1658.

Results from copying line 70.

Test plan:
Run Holds.t

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 531f710cac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-11-10 13:35:21 -10:00