Commit Graph

343 Commits

Author SHA1 Message Date
Jared Camins-Esakov ee2a238c1b Bug 7702: [SIGNED-OFF] MARC21 heading tests should not run under UNIMARC
Skip the MARC21-specific tests in t/Heading_MARC21.t if the marcflavour is
UNIMARC.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
I set marcflavour = UNIMARC for testing this.
Before the patch, t/Heading_MARC21.t fails. After the patch it
succeeds.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-05-05 08:15:19 -04:00
Jared Camins-Esakov 711afab1cc Bug 7724: Skip Linker test if Zebra isn't set up
One of the tests in t/db_dependent/Linker_FirstMatch.t ony works if Zebra is
running and authorities have been indexed. This was causing Jenkins agitas.
The test should be skipped if Zebra isn't running or authorities have not been
indexed at the time the test is run.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-05-05 08:13:03 -04:00
MJ Ray 53ef224eb2 bug 7284: fix package build problem, move BEGIN into new
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-05-05 06:52:10 -04:00
Jared Camins-Esakov c25ab911c0 Bug 7284: Authority matching improvements
Squashed patch incorporating all previous patches (there is no functional
change compared to the previous version of this patch, this patch merely
squashes the original patch and follow-up, and rebases on latest master).

=== TL;DR VERSION ===
*** Installation ***
1. Run installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt1
and installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt2
2. Make sure you copy the following files from kohaclone to koha-dev:
etc/zeradb/authorities/etc/bib1.att,
etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml,
etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl,
etc/zebradb/marc_defs/marc21/authorities/koha-indexdefs-to-zebra.xsl, and
etc/zebradb/marc_defs/unimarc/authorities/record.abs
3. Run misc/migration_tools/rebuild_zebra.pl -a -r

*** New sysprefs ***
* AutoCreateAuthorities
* CatalogModuleRelink
* LinkerModule
* LinkerOptions
* LinkerRelink
* LinkerKeepStale

*** Important notes ***
You must have rebuild_zebra processing the zebraqueue for bibs when testing this
patch.

=== DESCRIPTION ===

*** Cataloging module ***
* Added an additional box to the authority finder plugin for "Heading match,"
  which consults not just the main entry but also See-from and See-also-from
  headings.

* With this patch, the automatic authority linking will actually work properly
  in the cataloging module. As Owen pointed out while testing the patch,
  though, longtime users of Koha will not be expecting that. In keeping with
  the principles of least surprise and maximum configurability, a new syspref,
  CatalogModuleRelink makes it possible to disable authority relinking in the
  cataloging module only (i.e. leaving it enabled for future runs of
  link_bibs_to_authorities.pl).  Note that though the default behavior matches
  the current behavior of Koha, it does not match the intended behavior.
  Libraries that want the intended behavior rather than the current behavior
  will need to adjust the CatalogModuleRelink syspref.

*** misc/link_bibs_to_authorities.pl ***
Added the following options to the misc/link_bibs_to_authorities.pl script:
--auth-limit        Only process those headings that match the authorities
                    matching the user-specified WHERE clause.
--bib-limit         Only process those bib records that match the
                    user-specified WHERE clause.
--commit            Commit the results to the database after every N records
                    are processed.
--link-report       Display a report of all the headings that were processed.

Converted misc/link_bibs_to_authorities.pl to use POD.

Added a detailed report of headings that linked, did not link, and linked
in a "fuzzy" fashion (the exact semantics of fuzzy are up to the individual
linker modules) during the run.

*** C4::Linker ***
Implemented new C4::Linker functionality to make it possible to easily add
custom authority linker algorithms. Currently available linker options are:
* Default: retains the current behavior of only creating links when there is
  an exact match to one and only one authority record; if the 'broader_headings'
  option is enabled, it will try to link to headings to authority records for
  broader headings by removing subfields from the end of the heading (NOTE:
  test the results before enabling broader_headings in a production system
  because its usefulness is very much dependent on individual sites' authority
  files)
* First Match: based on Default, creates a link to the *first* authority
  record that matches a given heading, even if there is more than one
  authority record that matches
* Last Match: based on Default, creates a link to the *last* authority
  record that matches a given heading, even if there is more than one record
  that matches

The API for linker modules is very simple. All modules should implement the
following two functions:
<get_link ($field)> - return the authid for the authority that should be
linked to the provided MARC::Field object, and a boolean to indicate whether
the match is "fuzzy" (the semantics of "fuzzy" are up to the individual plugin).
In order to handle authority limits, get_link should always end with:
    return $self->SUPER::_handle_auth_limit($authid), $fuzzy;

<flip_heading ($field)> - return a MARC::Field object with the heading flipped
to the preferred form. At present this routine is not used, and can be a stub.

Made the linking functionality use the SearchAuthorities in C4::AuthoritiesMarc
rather than SimpleSearch in C4::Search. Once C4::Search has been refactored,
SearchAuthorities should be rewritten to simply call into C4::Search. However,
at this time C4::Search cannot handle authority searching. Also fixed numerous
performance issues in SearchAuthorities and the Linker script:
* Correctly destroy ZOOM recordsets in SearchAuthorities when finished. If left
  undestroyed, efficiency appears to approach O(log n^n)
* Add an optional $skipmetadata flag to SearchAuthorities that can be used to
  avoid additional calls into Zebra when all that is wanted are authority
  records and not statistics about their use

*** New sysprefs ***
* AutoCreateAuthorities - When this and BiblioAddsAuthorities are both turned
  on, automatically create authority records for headings that don't have
  any authority link when cataloging. When BiblioAddsAuthorities is on and
  AutoCreateAuthorities is turned off, do not automatically generate authority
  records, but allow the user to enter headings that don't match an existing
  authority. When BiblioAddsAuthorities is off, this has no effect.
* CatalogModuleRelink - when turned on, the automatic linker will relink
  headings when a record is saved in the cataloging module when LinkerRelink
  is turned on, even if the headings were manually linked to a different
  authority by the cataloger. When turned off (the default), the automatic
  linker will not relink any headings that have already been linked when a
  record is saved.
* LinkerModule - Chooses which linker module to use for matching headings
  (current options are as described above in the section on linker options:
  "Default," "FirstMatch," and "LastMatch")
* LinkerOptions - A pipe-separated list of options to set for the authority
  linker (at the moment, the only option available is "broader_headings," which
  is described below)
* LinkerRelink - When turned on, the linker will confirm the links for headings
  that have previously been linked to an authority record when it runs. When
  turned off, any heading with an existing link will be ignored.
* LinkerKeepStale - When turned on, the linker will never *delete* a link to an
  authority record, though, depending on the value of LinkerRelink, it may
  change the link.

*** Other changes ***
* Cleaned up authorities code by removing unused functions and adding
  unimplemented functions and added some unit tests.

* This patch also modifies the authority indexing to remove trailing punctuation
  from Match indexes.

* Replace the old BiblioAddAuthorities subroutines with calls into the new
  C4::Linker routines.

* Add a simple implementation for C4::Heading::UNIMARC. (With thanks to F.
  Demians, 2011.01.09) Correct C4::Heading::UNIMARC class loading. Create
  biblio tag to authority types data structure at initialization rather than
  querying DB.

* Ran perltidy on all changed code.

*** Linker Options ***
Enter "broader_headings" in LinkerOptions. With this option, the linker will
try to match the following heading as follows:
=600  10$aCamins-Esakov, Jared$xCoin collections$vCatalogs$vEarly works to
1800.

First: Camins-Esakov, Jared--Coin collections--Catalogs--Early works to 1800
Next: Camins-Esakov, Jared--Coin collections--Catalogs
Next: Camins-Esakov, Jared--Coin collections
Next: Camins-Esakov, Jared (matches! if a previous attempt had matched, it
would not have tried this)

This is probably relevant only to MARC21 and LCSH, but could potentially be of
great use to libraries that make heavy use of floating subdivisions.

=== TESTING PLAN ===

Note: all of these tests require that you have some authority records,
preferably for headings that actually appear in your bibliographic data. At
least one authority record must contain a "see from" reference (remember which
one contains this, as you'll need it for some of the tests). The number shown
in the "Used in" column in the authority module is populated using Zebra
searches of the bibliographic database, so you *must* have
rebuild_zebra.pl -b -z [-x] running in cron, or manually run it after running
the linker.

*** Testing the Heading match in the cataloging plugin ***
1.  Create a new record, and open the cataloging plugin for an
    authority-controlled field.
2.  Search for an authority by entering the "see from" term in the Heading Match
    box
3.  Confirm that the appropriate heading shows up
4.  Search for an authority by entering the preferred heading into the Main
    entry or Main entry ($a only) box (i.e., repeat the procedure you usually
    use for cataloging, whatever that may be)
5.  Confirm that the appropriate heading shows up

*** Testing the cataloging interface ***
6.  Turn off BiblioAddsAuthorities
7.  Confirm that you cannot enter text directly in an authority-controlled field
8.  Confirm that if you search for a heading using the authority control plugin
    the heading is inserted (note, however, that this patch does not AND IS NOT
    INTENDED TO fix the bugs in the authority plugin with duplicate subfields;
    those are wholly out of scope- this check is for regressions)
9.  Turn on BiblioAddsAuthorities and AutoCreateAuthorities
10. Confirm that you can enter text directly into an authority-controlled field,
    and if you enter a heading that doesn't currently have an authority record,
    an authority record stub is automatically created, and the heading you
    entered linked
11. Confirm that if you enter a heading with only a subfield $a that fully
    *matches* an existing heading (i.e. the existing heading has only
    subfield $a populated), the authid for that heading is inserted into
    subfield $9
12. Confirm that if you enter a heading with multiple subfields that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
13. Turn on BiblioAddsAuthorities and turn off AutoCreateAuthorities
14. Confirm that you can enter text directly into an authority-controlled field,
    and if you enter a heading that doesn't currently have an authority record,
    an authority record stub is *not* created
15. Confirm that if you enter a heading with only a subfield $a that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
16. Confirm that if you enter a heading with multiple subfields that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
17. Create a record and link an authority record to an authorized field using
    the authority plugin.
18. Save the record. Ensure that the heading is linked to the appropriate
    authority.
19. Open the record. Change the heading manually to something else, leaving
    the link. Save the record.
20. Ensure that the heading remains linked to that same authority.
21. Change CatalogModuleRelink to "on."
22. Open the record. Use the authority plugin to link that heading to the
    same authority record you did earlier.
23. Save the record. Ensure that the heading is linked to the appropriate
    authority.
24. Open the record. Change the heading manually to something else, leaving
    the link. Save the record.
25. Ensure that the heading is no longer linked to the old authority record.

*** Testing link_bibs_to_authorities.pl ***
26. Set LinkerModule to "Default," turn on LinkerRelink and
    BiblioAddsAuthorities, and turn AutoCreateAuthorities and
    LinkerKeepStale off
27. Edit one bib record so that an authority controlled field that has already
    been linked (i.e. has data in $9) has a heading that does not match any
    authority record in your database
28. Run misc/link_bibs_to_authorities.pl --link-report --verbose --test (you may
    want to pipe the output into less or a file, as the result is quite a lot of
    information)
29. Look over the report to see if the headings that you have authority records
    for report being matched, that the heading you modified in step 2 is
    reported as "unlinked," and confirm that no changes were actually made to
    the database (to check this, look at the bib record you edited earlier, and
    check that the authid in the field you edited hasn't changed)
30. Run misc/link_bibs_to_authorities.pl --link-report --verbose (you may want
    to pipe the output into less or a file, as the result is quite a lot of
    information)
31. Check that the heading you modified has been unlinked
32. Change the modified heading back to whatever it was, but don't use the
    authority control plugin to populate $9
33. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
34. Confirm that the heading has been linked to the correct authority record
35. Turn LinkerKeepStale on
36. Change that heading to something else
37. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
38. Confirm that the $9 has not changed
39. Turn LinkerKeepStale off
40. Create two authorities with the same heading
41. Run misc/migration_tools/rebuild_zebra.pl -a -z
42. Enter that heading into the bibliographic record you are working with
43. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
44. Confirm that the heading has not been linked
45. Change LinkerModule to "FirstMatch"
46. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
47. Confirm that the heading has been linked to the first authority record it
    matches
48. Change LinkerModule to "LastMatch"
49. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
50. Confirm that the heading has been linked to the second authority record it
    matches
51. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --auth-limit="authid=${AUTH}" (replacing ${AUTH} with an authid)
52. Confirm that only that heading is displayed in the report, and only those
    bibs with that heading have been changed

If all those things worked, good news! You're ready to sign off on the patch
for bug 7284.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master and squashed follow-up, 16 February 2012
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master, 21 February 2012

Signed-off-by: schuster <dschust1@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Tested with an UNIMARC setup that things work fine. They do

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Cherry-picked onto 3.6.x, 10 March 2012
Note for RMaint: this patch squashes all the bug 7284 patches from Master,
including the updatedatabase changes (but does not set the DB revision).

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-05-05 06:51:42 -04:00
Paul Poulain 870a4204fa Bug 6137 follow-up, moving new test to db_dependent directory
(cherry picked from commit 46a5154df9)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 21:00:39 -05:00
Julian Maurice b35218a1a4 Bug 6137: unit tests for C4::Circulation::_GetCircControlBranch
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 76be6208ee)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 21:00:39 -05:00
Jonathan Druart 3390239521 Bug 5346: Linking suggestions and orders.
Display suggestion info in acquisition module:
  basket.pl
  neworderempty.pl
  orderreceive.pl
  parcel.pl

To Test:
Create a suggestion and accept it.
Create a new order from this suggestion
Receive this order

For each step, check if suggestion info are visible.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test provides more unit tests, all complete successfully.
perl t/db_dependent/Suggestions.t
Note: test case should be cleaned up after running tests.

Display changes are consistent and information about the suggestion
is shown on every important screen now.

I created an order from a suggestion and one from an existing record.

No problems found.
(cherry picked from commit 0200639b00)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 21:00:33 -05:00
Chris Cormack 6f251690ff Bug 5327 : Removing a broken test
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 181f3b36ee)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 21:00:20 -05:00
Chris Cormack 07af219057 Bug 929 : Follow up, shifting test
(cherry picked from commit 6a06860f0c)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 21:00:16 -05:00
Robin Sheat 316dc62867 Bug 5327 - move another test around
(cherry picked from commit 8aacb28fc0)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 21:00:02 -05:00
Chris Cormack e0612c01d9 Bug 5327: Shifting a db dependent test to the right place
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
(cherry picked from commit 227cafe8c2)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 21:00:01 -05:00
Sam Sanders ed9eac7dd0 Bug 5327 added tests for C4/Languages.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit a0c1414f6d)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 20:59:58 -05:00
Connor Dewar bb06b9ac1b Bug 5327 Added unit tests for C4/SIP/ILS/Transaction/Renew.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 597fabf4f4)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 20:59:58 -05:00
Bart Jorgensen 669ec24c28 Bug 5327 added unit tests for C4/TmplToken.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 37c9ffcf7d)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 20:59:57 -05:00
Kate Henderson 91aab0fddf Bug 5327 added unit tests for C4/Search_PazPar2.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 66fecdd798)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 20:59:57 -05:00
Kate Henderson a36582632d Bug 5327 added unit tests for C4/Scheduler.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 1e2e7b9dd8)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:54:04 -05:00
Sam Sanders 88aee70187 bug 5327 added unit tests for C4/Ris.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 0618b9db72)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:54:03 -05:00
Jono Mingard cbccfdbb61 Bug 5327 added unit tests for C4/Creators/PDF.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit e81cbd7fe0)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:54:03 -05:00
Sam Sanders 2d113b9303 Bug 5327 added unit tests for C4/ClassSortRoutine/LCC
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 200b5a8231)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:54:03 -05:00
Jorgia Kelsey dbf3a3df34 Bug 5327 added unit tests for C4/Barcodes_PrinterConfig.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 1a20feb4ca)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:54:03 -05:00
Jono Mingard 675315473a Bug 5327 added unit tests for C4/AuthoritiesMarc/MARC21.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 5579abe41f)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:54:02 -05:00
Sam Sanders 60bf1f0594 Bug 5327 added tests for C4/Labels.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 3b9722c7dd)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:54:02 -05:00
Sam Sanders 329e39b8cc bug 5327 added unit test for C4/Csv.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit f918c57e89)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:54:02 -05:00
Colin Campbell 960da426a8 Bug 6752: Be stricter with utf-8 encoding of output
use encoding(UTF-8) rather than utf-8 for stricter
encoding
Marking output as ':utf8' only flags the data as utf8
using :encoding(UTF-8) also checks it as valid utf-8
see binmode in perlfunc for more details
In accordance with the robustness principle input
filehandles have not been changed as code may make
the undocumented assumption that invalid utf-8 is present
in the imput
Fixes errors reported by t/00-testcritic.t
Where feasable some filehandles have been made lexical rather than
reusing global filehandle vars

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 263dded818)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:51:19 -05:00
Chris Cormack 3c52fd6f8e Updating perlcriticrc to allow Modern::Perl to suffice instead of use warnings; and use strict;
http://bugs.koha-community.org/show_bug.cgi?id=6836

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
(cherry picked from commit c77b8756f7)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-02-19 15:48:26 -05:00
Sam Sanders d297f4d267 bug 5327 add tests for C4/BackgroundJob.pm
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
perl t/db_dependent/BackgroundJob.t
All tests complete successfully.

Note: Test 11 does not tell what it's about, but it has been there before.
(cherry picked from commit dbb29b4042)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-18 10:11:01 -05:00
Connor Dewar e44ed03423 Bug 5327 Added unit tests for C4/Reports.pm
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
perl t/Reports.t b/t/Reports.t
All tests complete successfully.
(cherry picked from commit e96c92d077)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-18 10:11:00 -05:00
Connor Dewar e4d759ff52 Bug 5327 Added unit tests for C4/ClassSortRoutine/Dewey.pm
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit f053ca0c22)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-18 10:11:00 -05:00
Connor Dewar 9bcc15b3f1 Bug 5327 added unit tests for C4/ClassSortRoutine/Generic
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 995485e574)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-18 10:10:59 -05:00
Paul Poulain 44f9128266 Bug 6990 follow up PODDOC & unit test updating
This patch removes the TransformKohaToMarcOneField sub, but there was some remaining POD & unit test about it
(cherry picked from commit 6456afea95)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-18 10:10:58 -05:00
Julian Maurice 14720f508d Bug 6132: Add unit test for system preferences
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 6eac5284ee)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-18 10:10:56 -05:00
Chris Cormack 7d4cc170ed Bug 929 : Follow up adding unit tests, discovered C4::Dates cached the syspref with no way to clear it, fixed also.
(cherry picked from commit 55d0b65522)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-18 10:10:55 -05:00
Chris Cormack bd05f46d12 Bug 929: Follow up adding the Koha:: namespace to the list of modules to test
(cherry picked from commit e6bbb97942)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-18 10:10:55 -05:00
Liz Rea 0668963124 Bug 7333 - Fixing up db_dependent/Search.t to use sample data Thanks to Chris N. for helping figure out that it was because there were no French stopwords in the DB that the test was failing.
Patch changes the French string (with French stopwords) to an English string with English stopwords, as only English stopwords are installed in the default data.

This patch will allow Search.t to run on the database attached to this bug.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 3c12d5f2f6)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:54:48 -05:00
Chris Cormack 28c00dd146 Test to check for XXX in kohaversion.pl or updatedatabase.pl
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works as advertised.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended the original patch of Chris to add two exceptions for a line in SetVersion and TransferToNum.

http://bugs.koha-community.org/show_bug.cgi?id=6700
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit bb92ac1ee0)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:47:28 -05:00
Srdjan Jankovic da99978777 bug_2830: Remove reserve when checking out if the borrower is not the first one in the reserve queue
To test:
Create 4 holds on a bib, for patrons A, B, C, and D,

Check in the item to mark hold as waiting for patron A
Check out the item to patron B -> reserve for patron B should be removed
Check in the item to mark hold as waiting for patron A
Check out the item to Patron A, hold should complete normally
Check in the item to mark hold as waiting for patron C
Check out the item to patron D -> reserve for patron D should be removed.
Check in the item to mark hold as waiting for patron C
Check out the item to patron C, hold should complete normally
Check in the item -> there should be no more reserves.

We also tested:
Created 4 holds on a bib with two items, for patrons A, B, C, and D

All worked as expected.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 6e07fd7b00)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:43:07 -05:00
Duncan Tyler 4e64d14700 Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test requires a database installed using the sample data.
All tests pass.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 3ae23cd6cf)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:43:06 -05:00
Liz Rea 3a42ff5d67 Bug 7333 - modifying Members.t to use a branchcode that exists in the sample data
To test:
Create a fresh koha db with all of the sample data (if you have one that has the sample branches in it, that will work too)
run the test: prove t/db_dependent/Members.t

All subtests should complete.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests complete successfully with my database created from
sample data and with the database provided on the bug.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit b955692c84)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:43:03 -05:00
Paul Poulain 2f95419c36 Revert "Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm"
This reverts commit 06c822c37c.
(cherry picked from commit 8df873c1a2)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:43:01 -05:00
Duncan Tyler caf02e8dca Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test requires a database installed using the sample data.
All tests pass.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 06c822c37c)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:43:00 -05:00
Chris Hall 31efcea6ca Added missing reference case to Boolean.t and corrected count
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 64a9c64100)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:43:00 -05:00
Chris Hall c8f04b8e7b Added missing reference case to Boolean.t and corrected count
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit dfa4b73737)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:42:59 -05:00
Duncan Tyler fc2a6415a9 Added unit tests for Scrubber
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 47b514cf56)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:42:59 -05:00
Duncan Tyler b418a16623 Added unit test for AuthoritiesMarc/UNIMARC.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit bb79d37b87)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:42:58 -05:00
Duncan Tyler 3aa19f2186 Added unit tests for Sip Checksum.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 7876d4fa8d)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-16 15:42:58 -05:00
Chris Cormack 5e57830a18 Bug 7215 : The Module changed, but the tests weren't updated to reflect that
Updating the test

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 9c66c42764)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-12-13 09:37:26 -05:00
Chris Cormack cbc13b7070 Bug 7141 : Changing test to match new formatting of xsl style sheet
http://bugs.koha-community.org/show_bug.cgi?id=7141
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
verified tests pass

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit ce59911932)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-12-08 14:46:32 -05:00
Chris Cormack 12ea57b606 Bug 6679 : Adding license statement and stopping declaring variables in a conditional
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-12-08 14:43:05 -05:00
Chris Cormack c5e6163efb Bug 6679 : cataloguing/ now passing critic tests
Declare variables outside of conditionals
Don't use prototypes http://www.modernperlbooks.com/mt/2009/08/the-problem-with-prototypes.html
Use ":encoding(UTF-8)" to get strict validation.

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-12-08 14:43:05 -05:00
Chris Cormack a8274cdfde Bug 6679: catalogue/ now passing perl critic tests
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-12-08 14:43:04 -05:00