Commit Graph

2233 Commits

Author SHA1 Message Date
Chris Cormack 1755613eea Bug 19593: follow up to fix tests 2017-12-20 10:40:39 +13:00
Jonathan Druart f1a72bba4c Bug 19655: Use ->build instead of build_object in 16.11.x
The build_object method of TestBuilder has been added by bug 18182,
which is not in 16.11.x

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2017-12-15 10:26:35 +13:00
Jonathan Druart 8c0692139e Bug 19655: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6a4b36bc3a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f2a828d551)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2017-12-12 21:22:23 +13:00
Jonathan Druart 97d7d92234 Bug 19487: Fix MarkIssueReturned.t
MarkIssueReturned must now return directly if the issue does not exist.
We then check if the anonymous patron configuration is correct.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 60bb936bc2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 49beda2176)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-11-20 22:26:52 +01:00
Katrin Fischer 389dd63c4e Bug 18999 (follow-up) - Fix failing test
Test was using methods not present in 16.11.x,
fixed by rewriting to old API.
2017-10-30 12:47:02 +00:00
Jonathan Druart a84c842f09 Bug 19423: Prevent DecreaseLoanHighHolds.t to fail randomly
CanBookBeIssued returns STATS if categorycode is X

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 090b450a50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fc4ee4aeec)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:54:34 +01:00
Mark Tompsett 2831770a95 Bug 17664: Silence non-zebra warnings in t/db_dependent/Search.t
TEST PLAN
---------
0) back up database
1) drop database; create database
2) run web installer
3) prove t/db_dependent/Search.t
   -- the spammy warnings (other than zebra index warnings) may
      already be fixed, but the mocked value was not realistic.
4) apply patch
5) prove t/db_dependent/Search.t
   -- notice only zebra index warnings.
6) run qa test tools

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5e63a38381)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 23c8acd615)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:51:46 +01:00
Marcel de Rooy 6c918b0eff Bug 19386: [QA Follow-up] Remove some default values
In the meantime bug 19403 added default nulls for gonenoaddress, lost
and debarred. So these lines can be removed safely.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 12a754a703)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e45ba75e9)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:48:09 +01:00
Jonathan Druart 8c50bbb182 Bug 19386: Prevent t/db_dependent/SIP/Patron.t to fail randomly
Depending on the values used by TestBuilder, some tests from t/db_dependent/SIP/Patron.t can fail

    #   Failed test 'Not blocked without overdues when set to 'Don't block''
    #   at t/db_dependent/SIP/Patron.t line 55.
    #          got: '0'
    #     expected: '1'

    #   Failed test 'Not blocked without overdues when set to 'confirmation''
    #   at t/db_dependent/SIP/Patron.t line 61.
    #          got: '0'
    #     expected: '1'

    #   Failed test 'Not blocked without overdues when set to 'Block''
    #   at t/db_dependent/SIP/Patron.t line 67.
    #          got: '0'
    #     expected: '1'

Caused by this check in C4::SIP::ILS::Patron->new
110     for (qw(EXPIRED CHARGES CREDITS GNA LOST DBARRED NOTES)) {
111         ($flags->{$_}) or next;
[...]
115         if ($flags->{$_}->{noissues}) {
116             foreach my $toggle (qw(charge_ok renew_ok recall_ok hold_ok inet)) {
117                 $ilspatron{$toggle} = 0;    # if we get noissues, disable everything
118             }
119         }
120     }

Test plan:
Execute several times (50x?) these tests.
Without this patch they may fail
With this patch they must never fail

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6545cfe3f3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 40c444cc2b)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:47:58 +01:00
Jonathan Druart cb95d0bfbf Bug 19392: Clean-up behind auth_values_input_www.t
The two categories created by this test script are not removed

Test plan:
without this patch, the two authorised value categories 学協会μμ and
tòmas are not removed when the script finishes.
Now it does!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 269c21d984)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 354645ef30)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:29:19 +01:00
Nick Clemens 74d13d33ca Bug 19307: Mock the AllowFineOverride preference to ensure expected result
To test:
 1 - Set 'AllowFineOverride' to allow
 2 - prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
 3 - 1 test fails
 4 - Apply patch
 5 - prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
 6 - All tests pass
 7 - Set 'AllowFineOverride' to 'Don't allow'
 8 - Tests should still pass

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1e2e1247c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86612541a4)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:24:59 +01:00
Fridolin Somers 876d955027 Bug 18999: (17.05.x followup) Koha::Acquisition::Order is not an object yet
(cherry picked from commit 1644708857)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:17:25 +01:00
Tomas Cohen Arazi bd65ae719e Bug 18999: (QA followup) ModReceiveOrder expects a hashref
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2b343df13e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 388ced2e74)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:17:14 +01:00
Alex Buckley dc7a7958f5 Bug 18999: (QA followup) Minor fixes for tests
Removed unneccessary declaration of $budget and changed
Koha::Acquisition::Order->new->insert into
Koha::Acquisition::Order->new->store as requested in tester feedback

Test plan:
1. Go into your koha-shell

2. set the PERL5LIB variable

3. Run t/db_dependent/Budgets.t

All tests should pass

Sponsored-by: Catalyst IT

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 90c5391b34)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8250e0f69a)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:16:50 +01:00
Alex Buckley 1cf8f51115 Bug 18999: Add regression tests
Added regression test for GetBudgetSpent() and GetBudgetOrdered() into
the t/db_dependent/Budgets.t

Test plan:
1. Go into your koha-shell

2. set the PERL5LIB variable

3. Run t/db_dependent/Budgets.t

All tests should pass

Sponsored-by: Catalyst IT

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 776692f311)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2df9a4c0e0)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 19:16:38 +01:00
Tomas Cohen Arazi e2ee7118d0 Bug 19337: Make basic_workflow.t configurable through ENV
This patch makes the basic_workflow.t selenium tests read ENV for the
following vars:

KOHA_USER
KOHA_PASS
KOHA_INTRANET_URL
SELENIUM_ADDR
SELENIUM_PORT

to properly configure the running environment. If absent, all variables
fallback to current behaviour:

KOHA_USER // 'koha'
KOHA_PASS // 'koha'
KOHA_INTRANET_URL (unchanged)
SELENIUM_ADDR // 'localhost'
SELENIUM_PORT // 4444

[*] Selenium defaults are documented on the Selenium::Remote::Driver docs.

Prerequisites:
Make sure you have a working environment for the Selenium tests:
- Run:
  $ sudo apt update
  $ sudo apt install xvfb firefox-esr

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ wget https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar \
     -O /tmp/selenium.jar
 k$ SELENIUM_PATH=/tmp/selenium.jar
 k$ Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &
 k$ DISPLAY=:1 java -jar $SELENIUM_PATH &
 k$ prove t/db_dependent/selenium/basic_workflow.t
=> SUCCESS: Tests pass
- Apply this patch
- Run:
 k$ prove t/db_dependent/selenium/basic_workflow.t
=> SUCCESS: Tests pass!
- Sign off :-D

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5bb19808bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f2b53042bd)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-29 18:51:29 +01:00
Mark Tompsett 8884545ef6 Bug 19120: Add tests to reproduce the problem
TEST PLAN
---------
1) apply this patch
2) prove t/db_dependent/Acquisition/close_reopen_basket.t
   -- FAILS!
   -- This proves the test works.
3) run koha qa test tools

Followed test plan, patch worked as described
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d34fae9499)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1b8e2f600a)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-18 23:15:33 +02:00
Jonathan Druart 77d232b41c Bug 19350: Add tests
(cherry picked from commit a2cc68e8b7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4ba051fd6e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-18 23:04:52 +02:00
Tomas Cohen Arazi 0b2e517259 Bug 19440: Identify overlimit problems in XISBN tests
This patch makes C4::XISBN::get_xisbns() return an errors hashref
including information of the failing fetches from xisbn services.

It tackles the situation of XISBN, which in some cases returns 'overlimit'
errors.

The patch makes the relevant functions check if the response->{stat} string
is 'ok' and returns the string in $errors otherwise.

This only happens when in list context. This allows to fix the randomly failing
tests while keeping the current behaviour.

All this code should be rewritten. It does the job bug doesn't have problems handling
or reoprting. This is just a band aid.

To test:
- Make sure
 k$ prove t/db_dependent/XISBN.t
=> SUCCESS :-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e908742418)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aaf0d3dc47)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-18 23:02:51 +02:00
Tomas Cohen Arazi b49ec7a57d Bug 18996: (followup) Fix tests count [16.11.x]
This patch fixes a wrong tests count introduced on merging.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2017-10-14 14:45:59 +02:00
Jonathan Druart a5ea0b2d8d Bug 19343: [16.11.X] Add tests 2017-10-14 13:55:11 +02:00
Josef Moravec dda4bca35d Bug 19116: (followup) Add tests to highlight the problem in CheckReserves
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a0c73b7bda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b3cd8c2def)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-14 13:53:11 +02:00
Jonathan Druart 9fef1265b7 Bug 19116: Unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 021d1d3714)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bc3bfeab37)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-14 13:52:24 +02:00
Mark Tompsett 319369ccc2 Bug 18897: Add skipping to t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t
Test Plan:
$ git fetch
$ git checkout -b bug_18897 origin/master
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
$ prove t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t
-- nasty failure.
$ git bz apply 18897
-- apply all the patches
$ prove t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t
-- nicer skip message
run the koha qa test tools

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2b4d0cb0b4)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:19:12 +02:00
Mark Tompsett 762fdf3e3c Bug 18897: Skipping t/db_dependend/00-strict elastic search stuffs as needed
Test Plan:
$ git fetch
$ git checkout -b bug_18897 origin/master
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
$ prove t/db_dependent/00-strict.t
-- nasty failure.
$ git bz apply 18897
-- interactive apply just the four patchs
$ prove t/db_dependent/00-strict.t
-- nicer skip message
run the koha qa test tools

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit faf651e514)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:19:01 +02:00
Mark Tompsett d708f57266 Bug 18897: Use Module::Load::Conditional::can_load
Rather than rely on eval(), Jonathan Druart recommended in
comment #6 to use Use Module::Load::Conditional::can_load.
This addresses that concern.

TEST PLAN
---------
$ git fetch
$ git checkout -b bug_18897 origin/master
$ git bz apply 18897
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
...
$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t
-- Note that the message says the correct library is missing.
$ sudo apt-get install libcatmandu-store-elasticsearch-perl
-- Note it runs as expected.
run the koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 088e332760)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:18:45 +02:00
Mark Tompsett 82db13b711 Bug 18897: Improve error message
Test Plan:
$ git fetch
$ git checkout -b bug_18897 origin/master
$ git bz apply 18897
-- interactive apply just the first patch
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
...
$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t
-- Note that the message says the wrong library is missing.
$ git bz apply 18897
-- interactive apply this patch
$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t
-- Note that the message says the correct library is missing.
run the koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a24ac20670)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:18:35 +02:00
Lee Jamison ecc6542c8c Bug 18897: Koha_Elasticsearch_Indexer.t doesn't skip when ES module(s) not installed
If Catmandu::Importer::MARC is not installed,
Koha_Elasticsearch_Indexer.t fails instead of skipping.
It should skip as ES is not currently mandatory.

Test Plan:
1. Run "prove t/db_dependent/Koha_Elasticsearch_Indexer.t"
   as koha-shell
2. Note failure on test 1/5 indicating module not installed.
3. Apply patch.
4. Re-run "prove t/db_dependent/Koha_Elasticsearch_Indexer.t"
5. Note test now skips.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b6b6acf285)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:18:12 +02:00
Jonathan Druart 0e5ae1af5d Bug 19385: Fix random t/Calendar.t failure - clear the cache before
The cache 'exception_holidays' may be populated when we run these tests,
we need to clear it before the tests are run.

Test plan:
  prove t/db_dependent/Circulation/CalcDateDue.t  t/Calendar.t

Without this patch, t/Calendar will fail with:
  #   Failed test 'Exception holiday is not a closed day test'
  #   at t/Calendar.t line 159.
  #          got: '1'
  #     expected: '0'
  # Looks like you failed 1 test of 38.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ae86b7ca9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 02d518b334)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:15:26 +02:00
Marcel de Rooy bd2602adac Bug 19004: Adjust AddReturn for retrieving item type
In the regular situation, you can get itemtype via biblio and then
biblioitem as well as via biblioitem (at least when item-level_itypes
is set to biblio).

But since Koha unfortunately defined two relations in item, one for
biblioitemnumber (the good one) and one for biblionumber (redundant),
TestBuilder (correctly) builds one biblioitem and two biblios.

If you item-level_itypes to biblio record, this will result in failing tests
when calling AddReturn (in this case Koha/Patrons.t).
It will crash on:
    Can't call method "itemtype" on an undefined value at C4/Circulation.pm line 1826.
Cause: AddReturn goes via the biblionumber to biblio and than to
biblioitems, and it does not find a biblioitem. (Not a fault from TestBuilder
but a database design problem.)

This patch makes a small change in AddReturn to retrieve the itemtype via
biblioitem. It actually is a shorter road than items->biblio->biblioitems.

Note: I do not test the Biblioitems->find call, since we already checked
the GetItem call before and we have a foreign key constraint.
I did not call $item->effective_itemtype since we still use GetItem; this
could be done later.

Adjusted Circulation/Returns.t too: If we add an item with TestBuilder and
we called AddBiblio before, we should link biblioitemnumber as well.

Test plan:
[1] Do not apply this patch yet.
[2] Set item-level_itypes to biblio record.
[3] Run t/db_dependent/Koha/Patrons.t. (It should fail.)
[4] Apply this patch.
[5] Run t/db_dependent/Koha/Patrons.t again.
[6] Run t/db_dependent/Circulation/Returns.t
[7] Git grep on AddReturn and run a few other tests calling it.
    Note: Bugs 19070/19071 address three tests that call AddReturn too.
[8] In the interface, check in a book.

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

Note: Bugs 19070 and 19071 are already pushed. The command in comment #4
      has all the tests successful.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0fc3f19605)
(cherry picked from commit fba3295669)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:13:14 +02:00
Marcel de Rooy 3435f41c3a Bug 19004: Patrons.t should create its own data for enrollment fees.
If the patron categories J, K, YA would not exist, Patrons.t would fail.

Test plan:
[1] Remove one of these patron categories.
[2] Run t/db_dependent/Koha/Patrons.t

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

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 57427f7a10)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2fdd3ef94a)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:12:53 +02:00
Colin Campbell 3f7c40b7eb Bug 19024 Fix some infelicities of phrasing in test messages
The test messages were awkwardly phrased, re phrase them to
sound more natuaral. Patch is cosmetic (grammar) only

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 16c25a3698)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 68cd778771)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:07:49 +02:00
Jonathan Druart c03a9a2d8c Bug 19024: Add tests
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7db6067dc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 342786ec9a)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-06 08:07:35 +02:00
Jonathan Druart e9a48b2ec7 Bug 9857: Fix failing tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 49778103ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 66c568941b)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-05 23:32:16 +02:00
Nick Clemens 7d448f6684 Bug 18812 - SIP Patron status does not respect OverduesBlockCirc
To test:
1 - Set 'OverduesBlockCirc' to block
2 - Find or create a patron with overdues
3 - Perform a SIP patron lookup on that patron
misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL
--patron {userid or cardnumber} --password {pass} -m patron_information
4 - Note the first character of response is a ' '
5 - Apply patch
6 - Restart memcached, apache, and plack
7 - Perform SIP patron lookup
8 - Note the first character of response is 'Y'
9 - prove t/db_dependent/SIP/Patron.t
10 - Test should return green

Signed-off-by: Chris Kirby <chris.kirby@ilsleypubliclibrary.org>
Works as advertised

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ff4f085895)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4b360f1371)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-05 23:28:38 +02:00
Jonathan Druart 400f2ea196 Bug 19335: Fix 00-merge-conflict-markers.t when dockerised
This does not make sense, but fix a bug (why?)
Without this patch, the tests failed on po files:

[17:14:26] t/00-merge-conflict-markers.t .. Failed 1/1 subtests
Test Summary Report
-------------------
t/00-merge-conflict-markers.t (Wstat: 9 Tests: 0 Failed: 0)
  Non-zero wait status: 9
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
Result: FAIL

Note that this is not related to bug 19227.

if the ^>>>>>> and ^<<<<<< matches are done on the same line, the test fail
As saw it failed on *-pref.po files
  misc/translator/po/kn-Knda-pref.po
  misc/translator/po/ja-Jpan-JP-pref.po
  misc/translator/po/nl-BE-pref.po
  misc/translator/po/sr-Cyrl-pref.po

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0d03f143e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bdfec37ab6)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-05 23:23:18 +02:00
Jonathan Druart 368dfc0815 Bug 19227: Reduce the number of tests run by 00-merge-conflict-markers.t
The number of tests on jenkins is sometimes confusing:

https://jenkins.koha-community.org/job/Koha_Master_D8/lastCompletedBuild/testReport/(root)/t_00_merge_conflict_markers_t/

shows that 00-merge-conflict-markers.t ran 10,751 tests, 124 less than
the previous run. However 124 files have not been removed from the
codebase!

I suggest to count only 1 test for all files.

Moreover files from blib and cover_db are counted, they should be
excluded.

Test plan:
  prove t/00-merge-conflict-markers.t
must return green

echo ">>>>>>>" >> mainpage.pl
and run the test again
It should now fail

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f8502b0d19)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7394fc99fc)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-05 23:12:33 +02:00
Jonathan Druart eb638bdc97 Bug 19391: (bug 19128 follow-up) Fix failing tests from auth_values_input_www.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b6f8cf4369)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 90dffe1c68)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-05 23:10:40 +02:00
Jonathan Druart b975b971b4 Bug 18794: Fix test ListMetadataFormats in OAI/Server.t
This test may fail on slow servers, it compares the response date with
'now', but both can differ a bit.

https://jenkins.koha-community.org/job/Koha_Master_D8/198/consoleFull

   Failed test 'ListMetadataFormats'
   at t/db_dependent/OAI/Server.t line 150.
     Structures begin differing at:
          $got->{responseDate} = '2017-06-12T14:31:51Z'
     $expected->{responseDate} = '2017-06-12T14:31:50Z'
2017-10-05 23:02:23 +02:00
Marcel de Rooy 1c0f364687 Bug 19126: Fix Members.t with IndependentBranches set
If you enabled that pref, Members.t fails with:
t/db_dependent/Members.t .. 63/63 # Looks like you failed 15 tests of 63.

The first one is:
t/db_dependent/Members.t .. 32/63
   Failed test 'Staff patron not deleted from list'
   at t/db_dependent/Members.t line 304.

Bottle neck is GetBorrowersToExpunge. The results of that sub depend on the
state of this preference.
Trivially fixing it here by disabling the pref before the first call.

Test plan:
[1] Do not apply this patch yet. Enable IndependentBranches.
[2] Run Members.t and observe that it fails.
[3] Apply this patch. And run Members.t again. It should pass now.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 44a8fc5b93)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 916d564055)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-02 00:19:46 +02:00
Nick Clemens 936bcce4ba Bug 18941 - Unit tests
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 22944fb612)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 69f0c2ece6)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:37:48 +02:00
Jonathan Druart 3fcfb2c003 Bug 13012: Add more tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 28a979487f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b83a18907)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:36:12 +02:00
Kyle M Hall aefcb510ae Bug 13012 - suggestion.suggesteddate should be set to NOW if not defined
Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Suggestions.t

Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b2a8e726fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e03ae320f7)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:35:51 +02:00
Marcel de Rooy 3b0827ef4f Bug 19071: Fix Members/IssueSlip.t
Resolve:
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_master`.`clubs`, CONSTRAINT `clubs_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) [for Statement "DELETE FROM branches"] at t/db_dependent/Members/IssueSlip.t line 44.

We do not need to delete all branches here.

Note: The test still needs attention for noisy userenv warns, but it should
pass now.

Test plan:
Run t/db_dependent/Members/IssueSlip.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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8651016ce8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3cdea3aaf6)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:33:20 +02:00
Marcel de Rooy a51fad02e4 Bug 19071: Fix Circulation/issue.t
Resolve:
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_master`.`clubs`, CONSTRAINT `clubs_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) [for Statement "DELETE FROM branches"] at t/db_dependent/Circulation/issue.t line 65.

Cause:
See also bug 19070.
We do not need to delete all branches here.

Test plan:
Run t/db_dependent/Circulation/issue.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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b80704aa1b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9f8b896d70)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:33:20 +02:00
Jonathan Druart a8ae524ffe Bug 19047: Fix AddBiblio call in ShelfBrowser.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b4ce1feb1b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2b903d74ac)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:29:44 +02:00
Marcel de Rooy cbf9b7d50a Bug 19047: Fix AddBiblio call in Reserves.t
AddBiblio does not return a title; the biblioitemnumber is stored in the
title variable.
The variables for biblioitemnumber are not used and can be removed.

Test plan:
Run t/db_dependent/Reserves.t

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c6f8cf69d3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c22e872820)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:29:30 +02:00
Jonathan Druart c3844b2ab5 Bug 19042: Add mock IndependentBranches=0 for the other test
These tests do not cover correctly getletter, but it is not the goal of
this patch. Superlibrarian behaviour must be tested as well.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e3dafbfccd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d1b5a9f5bb)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:28:33 +02:00
Mark Tompsett 369216769b Bug 19042: Silence warnings t/db_dependent/Letters.t
TEST PLAN
---------
prove t/db_dependent/Letters.t
-- there will be a message: "C4::Context->userenv not defined!"
apply this patch
prove t/db_dependent/Letters.t
-- there will no longer be that message.
run qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d01ce104a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 306614068e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:28:22 +02:00
Jonathan Druart c1f29c5914 Bug 17699: Reset time simulation
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0853c4e2b4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d3e6a1a5fd)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-10-01 23:23:51 +02:00