Commit graph

1349 commits

Author SHA1 Message Date
d7d64c0718 Bug 14905: Search_utf8.t fails to upload a file
Running the test fails on test 7:
not ok 7 - upload succeeded

The changes on bug 14321 included a temp flag for script upload-file.pl.
Since this upload for stage-marc-import should be temporary, adding this
flag to line 131 resolves the problem.

Test plan:
Run the adjusted test.
NOTE: I still had some problems with this test. And will still be looking
to these errors (perhaps open a new report). But this fix should at least
fix the above-mentioned test.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-28 11:47:02 -03:00
9f753799d8 Bug 14321: [QA Follow-up] Additional QA requests
This patch makes following requested changes:

[1] Renamed categorycode to uploadcategorycode (with atomicupdate file)
[2] Confirmation before deleting an uploaded file
[3] Label for Public checkbox can be clicked
[4] Back button on result list (not in plugin mode)
[5] Correct additional variable interpolation from sql queries

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested the db revision, unit test.
Uploaded temporary and permanent file, incl. plugin mode.
Deleted an upload.
Ran stage-marc-import.pl.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 12:02:52 -03:00
f8a58d310e Bug 14321: Final cleanup, removing obsolete files
The new Upload.pm, unit test and file-upload.js obsolete a number of
files, including an older jQuery plugin.
The test files progressbar.pl and progressbarsubmit.pl are outdated and
do not serve any purpose in this form. (Actually, we could argue if they
should be here or just be part of a debugging phase.)

Test plan:
[1] Git grep on file-progress, file-upload.inc, UploadedFile,
    ajaxfileupload, ajaxFileUpload
    UploadedFile: Only a reference to DBIx file is found
    ajaxfileupload: Only release notes
[2] Upload a file with tools/upload and stage-marc-import.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 12:02:52 -03:00
ba62a7ef24 Bug 14321: Introduce Koha::Upload
This patch introduces Koha::Upload. It will replace the modules
C4::UploadedFile.pm and the new C4::UploadedFiles.pm (from BZ 6874).
It also includes a new unit test.

NOTE: This unit test will replace the test for UploadedFiles.pm. It will no
longer use dependency Test::CGI::Multipart. We are now mocking CGI and its
hook to achieve the same result.

Test plan:
[1] Run t/db_dependent/Upload.t.
    Note that if you see a WARNING, you will still need to add an entry
    upload_path to your koha-conf.xml. Or you need to give write
    permission to your Koha instance user for that folder.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 12:02:51 -03:00
9acd29fc25 Bug 14297: Unit Tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 11:59:56 -03:00
bd021d2103 Bug 14733: (QA followup) make tests independent of already defined branches
The current tests were expecting the first defined branch to be CPL. That's
not the case on my box so they failed. This patch adds the creation of two
new random branches/branchcodes, and replaces the legacy use of CPL and MPL
in favour of the new ones.
It relies on TestBuilder for the task.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 11:47:25 -03:00
e16367f0a8 Bug 14733: Unit Tests
Signed-off-by: Heather Braum <hbraum@nekls.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 11:25:18 -03:00
Jonathan Druart
2fe521d11c Bug 12252: Add tests for EmbedItemsInMarcBiblio
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-17 11:02:17 -03:00
10820de380 Bug 14640: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 11:00:17 -03:00
ae5ee62d59 Bug 7634: Add tests
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:56:07 -03:00
704aed77ea Bug 7634: Make the tests pass
This patch just fixed a master bug, if your database already has some
items.homebranch set to CPL

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:56:07 -03:00
224b1c7976 Bug 6756: Fix bad behaviors if AnonymousPatron is not defined
There are at least 2 wrong behaviors if the AnonymousPatron pref is not
defined (0 or empty string).
1/ If you use the clean borrower tools, you will get a successful
message when the nothing happened (the history has not been anonymised).
2/ At the OPAC, if a patron ask for delete his reading history, he will
get an error message "The deletion of your reading history failed,
because there is a problem with the configuration of this feature.
Please help to fix the system by informing your libr    ary of this
error". IMO this should not happen, the history should be anonymised.

With this patch, the old_issues.borrowernumber field will be set to NULL
if the AnonymousPatron pref if not defined.

Test plan:
1/ Fill the pref with "" or 0
2/ At the OPAC, go on the privacy tab and click on the "Immedia deletion" button.
You should get a green and friendly message. Confirm that the history
has been anonymised.
3/ Use the "Batch patron anonymization" tools (tools/cleanborrowers.pl)
to anonymize the checkout history.
Confirm that a) it works and b) you get a message.

Try again with AnonymousPatron set to a valid patron. You should not see
any changes with the current behaviors.

NOTE: This patch tweaks C4/Circulation.pm and provides tests.
      applying just this, and running prove success. Reverting just
      C4/Circulation.pm fails, as expected.
      Tested OPAC stuff with both patches applied.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:55:42 -03:00
72d9c28bbf Bug 13622: [QA Follow-up] Add unit test descriptions
This report adds a few unit tests for datonly flag in notices.
This patch adds (very trivial) unit test descriptions.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:49:54 -03:00
Jonathan Druart
cef7cd40ce Bug 13622: Display a datetime without time in a notice
For some needs, a librarian would like to display a datetime or
timestamp field without the time.

This patch adds filter logic in the notice/letter parsing process.

Test plan:
1/ Defined a notice using a datetime or timestamp DB field
(biblio.timestamp for instance).
2/ Generate the notice
3/ Verify that the letter is generated with the time
4/ Use the "dateonly" filter like:
  <<your_table.your_field | dateonly>>
  <<biblio.timestamp | dateonly>>
5/ Generate the notice
6/ Confirm the the letter is generated without the time for this field.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Updated the count of tests to 64 for t/db_dependent/Letters.t to pass
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:49:54 -03:00
Jonathan Druart
f062542978 Bug 14197: TestBuilder - Remove the error on starting the transaction
DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1560.
DBIx::Class::Storage::DBI::txn_rollback(): Storage transaction_depth 0 does not match false AutoCommit of DBI::db=HASH(0xa429648), attempting ROLLBACK anyway at t/lib/TestBuilder.pm line 363

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:40:35 -03:00
Jonathan Druart
0b6460b191 Bug 14197: Remove the warning on destroying TestBuilder objects
This module will be called by db_dependent tests, which already create a
transaction.
TestBuilder creates a new one (which is certainly useless) and the
rollback does not do anything.

To see the warning see patches on bug 14045.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:40:35 -03:00
9f8f33e351 Bug 8723: Update the reserves table for item-level holds
If an item is moved from a biblio to another, the holds should be
updated too.

See discussion on the bug report for more information.

Test plan:
1/ Place a item-level hold on biblio1
2/ Move the item to biblio2
3/ Confirm that the hold still exists and point to the biblio2

This patch should not change the existing behavior for bib-level holds.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:39:02 -03:00
cb4ce631c3 Bug 8723: Cover the existing behavior
This patch cover the MoveItemFromBiblio subroutine

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:39:01 -03:00
Katrin Fischer
f704fbebd8 Bug 14782: Add tests
Run:
perl t/db_dependent/Utils/Datatables_Members.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:36:40 -03:00
8b710d62d1 Bug 14801: Fix Reserves.t
Fix the following errors:
not ok 59 - Bug 14464 - No fines at beginning
ok 60 - Bug 14464 - 1st reserve correctly created
not ok 61 - Bug 14464 - No fines after cancelling reserve with no charge configured
ok 62 - Bug 14464 - 2nd reserve correctly created
not ok 63 - Bug 14464 - No fines after cancelling reserve with no charge desired

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended the x==0 test with !x || x==0 to include 0.00 and prevent warn.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:19:38 -03:00
Mark Tompsett
cc2452df23 Bug 12357: Following whitespace failures on koha qa test tools.
TEST PLAN
---------
1) Apply all patches before this.
2) run koha qa test tools
   -- whitespace failures
3) Apply this patch
4) run koha qa test tools
   -- no whitespace failures.

NOTE: More tabs were fixed than required, to also clean up a little indenting.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Koha-qa tools now happy

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 13:59:07 -03:00
d997b0b1f0 Bug 12357: [QA Followup] - Unit Test
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
This works with next patch

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 13:58:49 -03:00
ea92a92f53 Bug 14470: Do not allow renew for on-site checkouts
At the opac, the renew checkbox should not be displayed if it's an
on-site checkout (same on the intranet).

On the way, this patch adds a specific message to the intranet if the
librarian try to renew an on-site checkout.
Indeed before this patch a renew was allowed if the barcode was scanned.

Test plan:
1/ Create an on-site checkout for a patron
2/ Confirm that the checkbox 'renew' is not displayed on the checkout
list tables
3/ At the OPAC, the renew should not be allowed (no checkbox)
4/ Try to check the item out to the same patron, confirm that you get a
specifig message to inform you the renew is not allowed for on-site
checkouts.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Changed 'issue' to 'item' in the error message.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 12:07:37 -03:00
40fc2a99c1 Bug 14639: (QA followup) make schema mandatory
This patch makes the 'schema' param mandatory. It is passed in every
call on the current codebase, so it makes no harm now, but makes
the code less error-prone.

Tests for this situation are added to t/Koha_MetadataRecord.t (schema
param is omitted and new() returns undef and a carped warning).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 12:06:21 -03:00
7587e7c752 Bug 14639: (regression tests) Extend Koha::MetadataRecord to handle serialization format and record id
In order to use Koha::MetadataRecord as a container for moving records
around it is important to let it carry the serialization format
of the record object it was built with, so it is easier and cheaper to
make decisions about records.

This patch introduces regression tests for the changes to be made.
The 'format' param is introduced, and also sets default values:
  schema => 'marc21'
  format => 'MARC'

A new (optional) 'id' param is added so the record carries its own id outside
of it.

The default behaviour is preserved, and no changes are needed in places
Koha::MetadataRecord is used.
->new also returns undef if no record is passed, and raises a carped warning.

To test:
- Apply this test patch
- Run the new tests
  $ prove t/Koha_MetadataRecord.t
=> FAIL: Tests shoud fail as the changes are not implemented on Koha::MetadataRecord

Edit: made serialization format be upper-case to match what is used on Koha::Filter's

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 12:06:21 -03:00
48e3e1ab27 Bug 14702: Unit tests for GetReserveFee and ChargeReservesFee
Test plan:
Run the test: t/db_dependent/Reserves/GetReserveFee.t

Signed-off-by: Joonas Kylmala <j.kylmala@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 12:04:49 -03:00
80abbe1fa3 Bug 14602: Fix failing t/Creators.t test
to test..

1/ run t/Creators.t test from git repo, get a FAIL

2/ apply patch

3/ repeat step 1, get a PASS

mason@xen1:~/g/k/3.16.x$ sudo  koha-shell -c 'export PERL5LIB=/home/mason/g/k/3.16.x ; cd /home/mason/g/k/3.16.x ;  prove -v  t/Creators.t' k316x1
t/Creators.t ..
1..16
ok 1 - use C4::Creators;
ok 2 - use C4::Creators::PDF;
ok 3 - testing new() works
ok 4 - testing pdf file created
ok 5 - testing Add() works
ok 6 - testing Bookmark() works
ok 7 - testing Compress() works
ok 8 - testing Font() works
ok 9 - testing FontSize() is set to 12 by default
ok 10 - testing FontSize() can be set to a different value
ok 11 - testing Page() works
ok 12 - testing StrWidth() returns correct point width
ok 13 - testing Text() writes from a given x-value
ok 14 - testing Text() writes to the correct x-value
ok 15 - testing End() works
ok 16 - test file /tmp/4YjPQDExeS created OK
ok
All tests successful.
Files=1, Tests=16,  1 wallclock secs ( 0.03 usr  0.01 sys +  0.48 cusr  0.05 csys =  0.57 CPU)
Result: PASS

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 11:39:47 -03:00
Jonathan Druart
f189696bb7 Bug 14098: Implement the copy_and_replace action for MTT
This patch implements the copy and replace action for the marc
modification templates.
Instead of copying a field/subfield, it will erase the destination
fields/subfields.

Test plan:
Find it yourself.
Compare the differences between the copy and the copy_and_replace
actions.
The easier way to test is to 1/ create a complete record, 2/create some
modification templates and 3/ use the batch record modification with the
"preview" function.

QA note: I kept the same tests as "copy" and, if no change were
expected, I noted them "(same as copy)", to be sure this new action won't
introduce regression on these tests.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 11:17:13 -03:00
Jonathan Druart
8c132e956e Bug 14098: FIX Copy a subfield should not update the original field
There is an inconsistency in the copy action:

Given the following control sample:

  245    _aThe art of computer programming
         _cDonald E. Knuth.
  300    _aA_exists
         _bB_exists

If we apply action (a) Copy the whole field 245 to 300, we get:

  245    _aThe art of computer programming
         _cDonald E. Knuth.
  300    _aA_exists
         _bB_exists
  300    _aThe art of computer programming
         _cDonald E. Knuth.

If we apply action (b) Copy the subfield 245$a to 300$a, we get:

  245    _aThe art of computer programming
         _cDonald E. Knuth.
  300    _aThe art of computer programming
         _bB_exists

In (a) the field is copied but in (b) the subfield is erased.

We should be consistent and don't erase the destination field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 11:17:12 -03:00
Tomas Cohen Arazi
efe3d17acc Bug 14651: (regression test) fallback to bib-level if itype is undef
Koha::Item->effective_itemtype should fallback to biblio-level itemtype
even if item-level item types are set, in the case the item has no itemtype
set (bad migration, bad old code).

To test:
- Run
  $ prove t/db_dependent/Items.t
=> FAIL: Koha::Item->effective_itemtype doesn't work properly

Edit: Added a test for a warning when falling back as per QA request
and because it made a lot of sense :-D

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 11:14:19 -03:00
7bad40dcc2 Bug 14717: Prevent 0000-00-00 on updating a patron
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 10:49:49 -03:00
1accce3870 Bug 14526: Add some unit tests for MoveReserve
The change in MoveReserve from the previous patch begs for a test.
Here we add some to Reserves.t.
In all six tests we place a hold, move it and check the reserves again.
Depending on the status of ConfirmFutureHolds, and the reservedate the
hold should be moved or not.

Test plan:
Run the unit test.
Bonus: If you run Reserves.t by applying this patch but without the first
patch that changed MoveReserve, tests 60 and 61 should fail:
    not ok 60 - MoveReserve filled future hold now
    not ok 61 - MoveReserve filled future waiting hold now
This may further illustrate the need of the first patch.

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:53:42 -03:00
Katrin Fischer
c4a4581a50 Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts
To test:
- prove t/db_dependent/Letters.t

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

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:41:41 -03:00
6e0b61e2ac Bug 11247: Improve tests
This patch makes the tests non dependent on the DB and test the 3 marc
flavours.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:36:33 -03:00
d1335a766d Bug 11247: Add a simple unit test for TransformHtmlToXml
The unit test is db dependent (as Jonathan correctly remarked),
since the sub checks a preference.

Test plan:
Run t/db_dependent/Biblio/TransformHtmlToXml.t

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: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:36:33 -03:00
9f0170668c Bug 14337: Add 2 more tests to be complete
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-28 10:42:33 -03:00
a2844a8a5c Bug 14337: Fix conflict with bug 9809
The reserves.constrainttype does not exist anymore, it has been removed
by bug 9809.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-28 10:42:33 -03:00
991a8181b2 Bug 14337: Add Unit Tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-28 10:41:35 -03:00
bf67f19ffb Bug 13697: (QA followup) Add Unit Test 2015-08-28 09:52:01 -03:00
ca341f6840 Bug 11190: sitemap.pl -- Generate a Catalog sitemap
Add a script sitemap.pl to process all biblio records from a Koha
instance and generate Sitemap files complying with this protocol as
described on http://sitemaps.org. The goal of this script is to be able
to provide to search engines direct access to biblio records. It avoid
leaving search engine browsing Koha OPAC and so generating a lot of
traffic, and workload, for a bad result.

Thanks Magnus for testing, and helping to improve the script design.

[2015.04.16] Switch from Moose to Moo.

[2015.08.20] Add complete (more) UT.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
All options to the script work as expected and the output looks
good. Nice enhancement!

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

I signed-of my own patch after fixing various QA errors.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: replace tabs with spaces.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 11:05:24 -03:00
34c11ee8ee Bug 12632: (regression tests) Unit Tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:42:04 -03:00
031a3196a4 Bug 9809: [QA Follow-up] Remove constrainttype from 14464 tests
Some additional unit tests of bug 14464 still included a constraint
in the AddReserve calls.

Test plan:
Run Reserves.t

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: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:26:56 -03:00
76f16b1b42 Bug 9809: Update unit tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:26:29 -03:00
Tomas Cohen Arazi
e2ad507500 Bug 14693: Contract.t should generate dates based on current date
The current test for still-active contracts fails because it was written
with fixed dates, which already passed :-D

This patch calculates the current date, and uses it to generate a future
one, so the tests serve their purpose no matter what the current date is.

To test:
- Run:
  $ prove t/db_dependent/Contract.t
=> FAIL: activeonly compares contractenddate with now(), and fails
         because a fixed 2015-07-31 is writteng on the test data
- Apply the patch
- Run:
  $ prove t/db_dependent/Contract.t
=> SUCCESS: the sample data has been calculated using the current date
            and the tests pass.
- Sign off :-D

Edit: added missing use DateTime::Duration,

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-21 10:43:38 -03:00
Jesse Weaver
4ce29452ad Bug 14464: (QA followup) add unit tests
This followup adds several tests to t/db_dependent/Reserves.t.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-21 09:20:22 -03:00
406098b20b Bug 14646: (regression test) Koha::RecordProcessor only accepts one filter at a time
This patch introduces new tests to t/RecordProcessor.t so it tests for
creating processors with more than one filter. It does so by running

    my $processor = new Koha::RecordProcessor({
                            filters => ['Null','Dummy']
                        });

and testing the results.

To test:
- Apply the patch
- Run:
  $ prove t/RecordProcessor.t
=> FAIL: tests related to multiple filters fail.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-20 13:44:15 -03:00
4a738888ad Bug 11229: Make the tests pass even if issues exist in the DB
This is not introduced by the previous patches of this patchset.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-18 13:18:21 -03:00
Tomas Cohen Arazi
a145b43785 Bug 11229: (regression tests) makepayment and makepartialpayment should log correctly
This patch introduces tests for makepayment and makepartialpayment to check
they are correctly logging to the statistics table.

To test:
- Run
  $ prove t/db_dependent/Accounts.t
=> FAIL: tests fail because statistics are not correctly logged.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-18 13:18:21 -03:00
Jonathan Druart
dcb5bf00aa Bug 13853: (follow-up) unit tests
Specify the reference, we should receive Koha::Object.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-11 14:49:03 -03:00
ae82953138 Bug 13853: (QA followup) Add unit tests for branch getting methods
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-11 14:48:45 -03:00