Do not use copyrightdate as it is weird to have it int
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>
To test:
1 - Apply just this patch
2 - prove -v t/db_dependent/Linker_Default.t
3 - It fails
4 - Apply second patch
5 - prove -v t/db_dependent/Linker_Default.t
6 - It passes
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 21450: Remove copyright lines
Signed-off-by: Nick Clemens <nick@bywatersolutions.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>
As Jonathan reported on comment11, SIP/Message.t fails now.
This is a trivial fix for that. In the first case we should just no longer
expect the alert flag. In the second case it makes more sense to toggle
the value of the checked_in_ok setting.
Test plan:
Run t/db_dependent/SIP/Message.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
It looks safe to do it here and now.
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: Nick Clemens <nick@bywatersolutions.com>
Due to a type in a call to output_pref (datenonly vs dateonly) we were
comparing logactions within a minutes accuracy. Counting the logs for
the day would be sufficient for the test ;)
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: Nick Clemens <nick@bywatersolutions.com>
After bug 21213 we wanted to know why Circulation.t was failing randomly on a given test.
Since it is pushed, it failed (at least) twice, with the same error:
# Failed test 'AddReturn must have debarred the patron'
# at t/db_dependent/Circulation.t line 3112.
# got: ''
# expected: '1'
# AddReturn returned message $VAR1 = {
# 'WasReturned' => 1
# };
# Failed test 'Test at line 1918'
# at t/db_dependent/Circulation.t line 3116.
# got: '0'
# expected: '1'
# Failed test 'Test at line 1918'
# at t/db_dependent/Circulation.t line 3119.
# got: undef
# expected: '2019-05-30'
# Looks like you failed 3 tests of 21.
The test at line 3113 expects the flags 'WasReturned' and 'Debarred' to be set,
but only WasReturned is.
Which means the patron has not been debarred. It is not because the checkout has
not been detected as overdue.
If you apply only the first patch you will see that the tests are failing with
the exact same failures.
Indeed, if due_date is not passed to test_debarment_on_checkout, it is set to now (dt_from_string).
However, if the call and the test of the parameters inside the subroutine takes
more than 1 second,
then due_date will be after what we really expect. To reproduce that, we add
1 minute to due_date and we observe the tests failing.
The trick here (and we should have in all our tests) is to mock
DateTime->now to make sure dt_from_string will always return the same
value, it is what we expect from our tests (in 99.9% of the cases at
least).
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch implements bug 15339 for build_object.
We want it to warn if the call is wrong.
Test plan:
Make sure the tests are still returning green
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds the budgetname to the return of SearchSuggestion
to improve performance.
To test:
- Same test plan as for the first patch
- Verify fund names show in the table
- Run t/db_dependent/Suggestions.t
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Ho, another bug!
The email was not correctly filtered.
Test plan:
Use the evil string for an email, do a search.
=> Notice that without this patch the results never show up
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>
Ho, a bug!
Some fields in the address where double filtered.
Test plan:
Use the evil strings in the address field and do a search, you will see
double html encoded characters without this patch.
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>
The patron's data was not correctly escaped actually.
Test plan:
This is a good value for the whole patchset: <strong>fir's"tname</strong> \123 ❤
use it for a patron's firstname, then do a search
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>
Test plan:
Apply only this patch
=> The tests will fail, the library's name is not correctly escaped.
Note:
This applies for the whole patchset, when the tests fail you will need
to remove the patrons added by the tests with the following SQL query:
delete from borrowers where surname like "test_patron_%";
We are expecting END to be called even if something goes wrong, but
DESTROY must be used instead. This will be fixed separately, on its own
bug report.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Since bug 21817 we should use the mock_userenv subroutine instead.
Test plan:
The tests must pass after this patch
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>
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>
One occurrence was missing.
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>
This reverts commit d9b3b90849.
https://bugs.koha-community.org/show_bug.cgi?id=22836
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>
Starting to write tests I realize that we are going to add too much
specific logic which is already handled in Koha::Object->store.
The easiest and safe way is to use it :)
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.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>
This patch changes pending_hold to has_pending_hold to signify that
we're returning a boolean and not a Koha::Hold object.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
To test:
1 - Enable course reserves
2 - Create a course
3 - Add an item to the course
4 - Attempt to view the course on the OPAC
5 - Internal Server Error
6 - Apply patch
7 - Add an item to the holds queue by placing a hold and running holds queue builder or:
INSERT INTO tmp_holdsqueue (itemnumber) VALUES (###);
8 - View the course page, note item appears 'Pending hold'
9 - Remove the holdsqueue line
10 - View the course page, note item appears 'Available'
11 - prove -v t/db_dependent/Koha/Item.t
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
I see Jonathan's comments about small improvements, but will sign off as
everything works as expected here.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Move to admin
Add a permission
Remove descriptions from table
Clean up template
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Almost everywhere we call IsAvailableForItemLevelRequest we already have
a Koha::Patron and Koha::Item object. It makes sense to use them to
avoid a refetch
Test plan:
It would be good to test this patch on top of 19300 and 19301 and make
sure everything works as expected
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Hard to know what's going on here without more info. Adding this output
may help to investigate more.
Test plan:
Make sure the tests still pass
If it fails, please paste the output!!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
The ReplyTo preferences allwo for libraries to setup various
combinations of addresses for email headers to ensure correct mail
delivery. This patch accounts for their configuration and use in the
suggestions notifications
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds 'None' to the available options for the feature so it
may be disabled entirely (and sets that as default)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
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>
This patch makes the tests enable the plugins that are required for
them. Otherwise unexpected failures can happen
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment #28 has a /36 which is invalid CIDR.
This triggers a crash and noise.
This cleans up the crash and noise, and adds
test cases to check for them.
prove t/Auth.t
-- before missing null case, and /36 case.
-- after null case, and /36 with/without warnings.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
TEST PLAN
---------
1) apply all pathches
2) sudo koha-shell -c bash kohadev
prove t/Auth.t
-- should run.
3) run koha qa test tools
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Scrambled email addresses will only generate warnings etc.
Clear them although they might be in BorrowerMandatoryField.
Test plan:
Run t/db_dependent/Koha/Patrons.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
t/db_depepended/Koha/Patrons.t runs with no warnings.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch makes the update script override the configured
enable_plugins setting in koha-conf.xml.
on testing the failure I wrote trivial tests on how
Koha::Plugins->new({ enable_plugins => 1 }) should work. Adding them to
this patch as well.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
If repeatable is set to 0 by TestBuilder, the tests will fail with:
t/db_dependent/Koha/Patron/Modifications.t .. 1/6 # Looks like you planned 20 tests but ran 9.
# Failed test 'approve tests'
# at t/db_dependent/Koha/Patron/Modifications.t line 259.
[repeatable not set for attribute type and tried to add a new attribute for the same code]# Looks like your test exited with 255 just after 5.
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>
I have no idea why this only appears today but TestBuilder generates dates using DateTime->now,
which does not take into account the timezone.
It has been highlights by a failing test today on U18.
Why today whereas this patch was pushed few weeks ago?
Why U18 and not D9?
The output of the test is:
koha_1 | # Failed test 'With BorrowerLogs and TrackLastPatronActivity we should not spam the logs'
koha_1 | # at t/db_dependent/Koha/Patrons.t line 1421.
koha_1 | # got: '2'
koha_1 | # expected: '1'
koha_1 | # Looks like you failed 1 test of 4.
koha_1 |
koha_1 | # Failed test 'BorrowersLog tests'
koha_1 | # at t/db_dependent/Koha/Patrons.t line 1422.
koha_1 | # Looks like you failed 1 test of 33.
koha_1 | [19:51:44] t/db_dependent/Koha/Patrons.t
Actually there are 2 logs, one for the cardnumber that is expected, and on for updated_on:
"updated_on" : {
"after" : "2019-03-04 21:10:00",
"before" : "2019-03-04 18:10:00"
}
Apart from the fact that we may want to remove this updated_on field from MODIFY,
the before/after dates differ from 3 hours.
Here it's currently 18:10 and in UTC-3
To prevent such behaviors in tests (create stuffs in the future...), we should
use our Koha::DateUtils::dt_from_string method that takes care of the timezone
used in other places of Koha.
Test plan:
prove t/db_dependent/Koha/Patrons.t
May fail without this patch.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This patch is fine in itself, but there may still be an issue around
the failing test for TrackLastPatronActivity. Reopened bug 22741.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Cache.t fails during package build. Moving it to db_dependent fixes
the problem.
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>
We were adding data to category 1 (private lists) and testing against
that, but we named the variable 'publist_lists'.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>