Commit Graph

429 Commits

Author SHA1 Message Date
Kyle M Hall 88e9aca318 Revert "Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded"
This reverts commit 262f1bb608.
2014-01-14 15:58:47 -05:00
Galen Charlton 0cd6eaad35 Bug 10653: (follow-up) minor tweaks to RotatingCollections tests
- remove unnecessary module import
- use parentheses for all C4 function calls

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 40aa42f31f)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 800e1fc6d0)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 800e1fc6d0)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit d5cc7da52a)
2013-10-22 08:34:37 +13:00
Kenza Zaki 693d947bb1 Bug 10653: add unit tests for C4::RotatingCollections.pm
The tests are wrap in a database transaction.

Test plan:
prove t/db_dependent/RotatingCollections.t
t/db_dependent/RotatingCollections.t .. ok
All tests successful.
Files=1, Tests=41, 20 wallclock secs ( 0.02 usr  0.01 sys +  0.41 cusr  0.02 csys =  0.46 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 12061f44be)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit eb0373c7eb)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit eb0373c7eb)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 338e966d65)
2013-10-22 08:32:37 +13:00
Jonathan Druart 262f1bb608 Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded
prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t
t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. ok
All tests successful.
Files=1, Tests=3,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.38 cusr
0.01 csys =  0.41 CPU)
Result: PASS

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1c8efaf3f9)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit af6c169f2a)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit af6c169f2a)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 9fc0c233dc)
2013-10-20 20:22:12 +13:00
Galen Charlton dbaef6ae87 Bug 10644: (follow-up) remove inadvertant dependence on Perl 5.14
Perl 5.14 changed array and hash container functions (e.g., keys())
to accept hashrefs or arrayrefs.  However, this doesn't work in
Perl 5.10, so doing

  scalar(keys( function_returning_hashref() ) );

is a syntax error in that version.  This patch changes the affected
tests to explicitly difference the hashrefs returned by the various
functions.

To test:

Verify that t/db_dependent/ClassSource.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8f933bc040)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 9504e00f7b)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 9504e00f7b)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 4e474580b1)
2013-09-17 19:57:20 +12:00
Galen Charlton 098c00da44 Bug 10644: fix typos in test descriptions
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d9d8a8424d)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 7e5c0a9a5f)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 7e5c0a9a5f)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 5c32b6e383)
2013-09-17 19:55:39 +12:00
Kenza Zaki 744e4fb3ed Bug 10644: add unit tests for ClassSource.pm
The tests are wrapped in a database transaction.

To test:
prove t/db_dependent/ClassSource.t
t/db_dependent/ClassSource.t .. 1/24 prepare_cached(SELECT * FROM `class_sort_rules` WHERE `class_sort_rule` = ?) statement handle DBI::st=HASH(0x92dbedc) still Active at C4/ClassSource.pm line 249
prepare_cached(SELECT * FROM `class_sources` WHERE cn_source = ?) statement handle DBI::st=HASH(0x926876c) still Active at C4/ClassSource.pm line 137
attempting to use non-existent class sorting routine routine1
prepare_cached(SELECT * FROM `class_sort_rules` WHERE `class_sort_rule` = ?) statement handle DBI::st=HASH(0x92dbedc) still Active at C4/ClassSource.pm line 249
prepare_cached(SELECT * FROM `class_sources` WHERE cn_source = ?) statement handle DBI::st=HASH(0x926876c) still Active at C4/ClassSource.pm line 137
t/db_dependent/ClassSource.t .. ok
All tests successful.
Files=1, Tests=24,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.12 cusr  0.01 csys =  0.15 CPU)
Result: PASS

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5de06b87e2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit aeb11a6a92)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit aeb11a6a92)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit b976a45151)
2013-09-17 19:54:40 +12:00
Jason Etheridge 1254f88b25 Bug 9770: test case for sorting of Dewey call numbers that contain prefixes
This adds a test for C4::ClassSortRoutine::Dewey to check that the
call number "JR DVD 800.1" sorts before "JR DVD 900"

To test:

[1] Apply just this patch.
[1] Run prove -v t/ClassSortRoutine_Dewey.t
[2] Test #7 should fail.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes test plan and QA script.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit bce45b4bf5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 926e455f19)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 926e455f19)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 74b2f3fb4a)
2013-08-20 21:15:11 +12:00
Galen Charlton ebdac79d5f Bug 10560: add regression test
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e2bb7af216)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit a8ed0e52c6)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit a8ed0e52c6)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 4cae528185)
2013-08-18 16:52:47 +12:00
Marcel de Rooy 96666e5aaa Bug 10386: improvements to VirtualShelves.t
Most important: Does no longer delete all shelves!
Checks if there are ten borrowers for testing. But even works without them :)
When creating or modifying lists, takes name clashes into consideration.

Small change to _CheckShelfName in VirtualShelves module. Making it possible to
check a name for a list whose owner has been set to NULL. Note that a test
like field=? with undef for placeholder will not work in MySql.

Test plan:
How do you test a test? Well, you could run it on various databases..
But for real hacking, you could also add some debug lines.
I tested this by forcing 10 undefs in @borrowernumbers.
And by overwriting the return value of randomname with an existing name.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 93e87ca0b6)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit a97b62379f)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit a97b62379f)

Fixed minor conflicts:
	C4/VirtualShelves.pm
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 5e9db705a5)
2013-08-18 10:58:14 +12:00
Marcel de Rooy bab007fb75 Bug 10290: Followup for Virtualshelves.t
Put the 10 biblionumbers in a list
Add a FIXME for deleting shelves
Do temporary repair on duplicate name test (Followup via report 10386)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1ef99ace20)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit e26655fe03)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Missed this one from previous release
(cherry picked from commit e26655fe03)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 2b24573294)
2013-08-18 10:56:52 +12:00
Jonathan Druart 61ad7c928d Bug 10290: UT: VirtualShelves.t needs to create its own data
Try before the patch:
prove t/db_dependent/VirtualShelves.t

And after, it should produce:
  t/db_dependent/VirtualShelves.t .. ok
  All tests successful.
  Files=1, Tests=82,  6 wallclock secs ( 0.03 usr  0.00 sys +  0.46 cusr  0.03 csys =  0.52 CPU)
  Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 44905ac99c)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Tests are good :-D. They look fine and work as expected.
(cherry picked from commit e918450e6a)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Missed this one from previous release
(cherry picked from commit e918450e6a)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit a16542961f)
2013-08-18 10:56:11 +12:00
Galen Charlton a84d6a228a move Auth_ParseSearchHistoryCookie.t to db_dependent directory
The actual tests in this script are not dependent on the database,
but simply loading C4::Auth requires a valid(ish) koha-conf.xml
and database.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-28 19:47:03 +00:00
Galen Charlton d4cad06ab2 do some validation of the KohaOpacRecentSearches cookie
Add validation of the value of the KohaOpacRecentSearches.  In
particular, this patch avoids the generation of an internal server
error when the OPAC is presented with an old cookie that uses the
old Storable-based serialization.

This patch also moves parsing of the cookie value into a
new routine in C4::Auth, ParseSearchHistoryCookie, and adds
a test case.

To test (in conjunction with the previous patch):

Exercise the OPAC search history functionality, after
turning on the EnableOpacSearchHistory syspref:

- As an anonymous user, conduct a variety of searches,
  including ones that include non-ASCII characters
- Check the search history and verify that all searches
  are listed
- Apply this patch and the previous one.
- Do *not* clear the KohaOpacRecentSearches cookie
- Check the search history and verify that no searches
  are listed any more
- As an anonymous user, conduct a variety of searches,
  including ones that include non-ASCII characters
- Check the search history and verify that all searches
  are listed
- Log into the OPAC
- Verify that current and past searches are listed in
  search history.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-28 03:16:57 +00:00
Jonathan Druart d7a6135a39 Bug 10458: t/Z3950.t should be removed too
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit cab50698f5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit d5f9a3ec5c)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit d5f9a3ec5c)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit bc51544b46)
2013-07-18 20:52:36 +12:00
Marcel de Rooy dc715257b7 Bug 10458: Remove obsolete Z3950 module and test
Are not used. Contain several FIXMEs.
Removing them makes life easier.

Test plan:
Actually, you cannot test this.
But for confidence: do a Z3950 search in cataloguing and acquisition.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 63ba05183e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 1dbd1d938a)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 1dbd1d938a)

Conflicts:
	C4/Z3950.pm

Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit b98c441915)
2013-07-18 20:51:10 +12:00
Galen Charlton 247a4c5ade bug 9370: add invalid call number to LC splitting test cases
'123 ABC FOO BAR' is intentionally *not* a valid LC call number,
but in order to preserve legacy behavior, it should be split on
whitespace.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a5e9e15663)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit d743b2084c)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit d743b2084c)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 0e82fef70b)
2013-07-17 20:14:17 +12:00
Galen Charlton d05322c185 bug 9370: test case for splitting LC call number
QH541.15.C6 C25 2012 should be split as follows:

QH
541.15
.C6
C25
2012

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ecf6721060)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 8ceab821b5)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 8ceab821b5)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 8ff1fc43c0)
2013-07-17 20:13:39 +12:00
Galen Charlton f0fce8915d bug 6281: introduce LC::CallNumber::LC for sorting LC call numbers
This replaces the previous hand-coded normalizer.  Because
LC::CallNumber::LC appears to reject strings that aren't valid
LC call numbers, significant changes to the test cases were
made as well -- however, the one that really counts is the
last one which verifies the sorting.

To recalculate the call number sort key for each item, it is necessary
to run misc/maintenance/touch_all_items.pl

To test, create item records with the following call numbers, setting
the classification sort to 'lcc':

QC100 .U57 NO. 555 1986
QC145 .A57 V.12 1980
QC145.45 .H4 D65 1998
QC995 .E29 1997

Next, make a report of them in the inventory tool.  The items should be sorted
in the above order.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit bc87274c66)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit d7862378f0)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit d7862378f0)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit a86d814225)
2013-07-17 19:53:00 +12:00
Galen Charlton 8d1bb2521f bug 6281: add test case for sorting LC call numbers correctly
My thanks to Michael Flanagan of UCAR for providing some of
these examples.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 87ab820a20)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit cee5651e11)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from cee5651e11)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from 0f6bff1348)
2013-07-17 19:51:46 +12:00
Jonathan Druart 6863bdbd4f Bug 10296: UT: t/data/db_schemas not needed
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

These were added with the intention of writing some
schema verification test cases, but if that idea
gets picked up again in the future, fresher copies
of kohastructure.sql can be obtained from Git.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d2ee2b5cf3)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 20bd5b63c4)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 20bd5b63c4)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 2974865622)
2013-06-17 21:02:54 +12:00
Jared Camins-Esakov 9086611f2d Bug 9174: Fix itemtype image display in OPAC lists
Prior to this patch, C4::VirtualShelves::Page did not make sure that
the itemtype images that it chose when displaying itemtype images for
biblio-level itemtypes were for the correct interface, so
even on the OPAC the Intranet icons were requested. On standard
installations, intranet-tmpl is not available to the OPAC.

To test:
1) Set noItemTypeImages to "Show" and item-level_items to "biblio record"
2) Create a list and add an item with the default item type (942$c in
   MARC21) set to something with an itemtype image associated with it.
3) View the list in the OPAC.
4) If you are an a standard install, the itemtype image will be a broken
   link. If on a dev install, you can confirm with Firebug or the like
   that the image is pulled from /intranet-tmpl.
5) Apply patch.
6) Run `prove t/db_dependent/Koha.t` to confirm that the behavior of the
   routine used to retrieve the image URL is correct. (Note that you
   must have an item type with the code 'BK')
7) Refresh the list, noting that the display is now correct/the image is
   pulled from opac-tmpl.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
It works as expected. All tests in Koha.t passed.
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:

	t/db_dependent/Koha.t

Squashed with: Bug 9174 follow-up: Eliminate warning and fix POD

Thanks to Marcel for spotting these issues.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2013-02-03 15:27:40 +13:00
Jared Camins-Esakov 313a664370 Bug 8924: Some modules erroneously skipped by 00-load
Several patterns were being skipped unnecessarily in t/00-load.t:
* C4::Cache* - no longer exists
* C4::Record - no longer requires database
* C4::Serials - no longer requires database

To test:
1) Unset KOHA_CONF and/or shut down MySQL.
2) Run `prove t/00-load.t`
3) If the test passes, the patch is good.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

144 tests passing.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:
	t/00-load.t

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2013-01-13 08:05:56 +13:00
Tomas Cohen Arazi 74bb56fbb3 Bug 9142 - Remove the use of subtests
Debian stable's version of Test::More is older than the one I used on my
12.04 dev box, and doesn't support subtests, which I used to avoid side
effects between different test scenarios.

This patch removes that subtest definition.

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
All tests passing in 3.10.x

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
All tests passing in 3.8.x
2012-11-29 15:23:43 +13:00
Tomas Cohen Arazi 1d69301468 Bug 8800 - useDaysMode=Datedue wrong behaviour (revisited)
useDaysMode=Datedue wasn't used as advertised in the docs. Added
next_open_day and prev_open_day subs to Koha::Calendar and some tests for them.

- Koha::Calendar->addDate was rewritten in a more sane way (also split into
  addHours and addDays for convenience).
- Fixed a bug introduced in Bug 8966 regarding dt truncation and dtSets->contains
- Minor docs typos
- Use the passed Calendar mode or default to 'Calendar' in Koha::Calendar->_mockinit.
- Tests

I'm writing some db-dependent tests for is_holiday, and hopefully for CalcDateDue so any
rewrite/followup doesn't break things.

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passed-QA-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:
	t/Calendar.t

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-11-26 13:22:56 +13:00
Maxime Pelletier 6a8bba271e Bug 8966 Koha::Calendar::is_holiday truncates the date
* Create a local copy of the date instead of calling truncate directly on the date
* Add a test to properly test that the issue is fixed

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-10-31 10:49:36 +13:00
Robin Sheat 15ba5f961f Bug 7642 - [3.8.x] fix the lost display of tag sizes
This fixes the display of different sized words for differently popular
tags. It is a bit of a refactor of that part of the system, moving
logic to more sensible places (and removing an unused method on the
way.)

Note that it isn't an attempt to reproduce what was there previously,
just to do something similar, and in an easier to change fashion.

Sponsored-By: New Zealand Educational Institute
Signed-off-by: Marc Veron <veron@veron.ch>
Works as expected.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-10-02 11:22:20 +13:00
Jared Camins-Esakov dca4002752 Bug 8524 follow-up: fix broken test
The t/Barcodes_ValueBuilder.t test had the wrong number of tests
declared, and rather than checking that a variable was undefined I was
checking that it had a length of zero. Fixed both issues.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-09-14 08:56:27 +12:00
Jared Camins-Esakov b194cb71d0 Bug 8524: Add a non-automatic barcode plugin
In addition to adding a new barcode plugin, this commit begins
refactoring the barcode generation code using a new module,
C4::Barcodes::ValueBuilder. From the POD:
    This module is intended as a shim to ease the eventual transition
    from having all barcode-related code in the value builder plugin
    barcode.pl file to using C4::Barcodes. Since the shift will require
    a rather significant amount of refactoring, this module will return
    value builder-formatted results, at first by merely running the
    code that was formerly in the barcodes.pl value builder, but later
    by using C4::Barcodes.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-09-14 08:56:01 +12:00
Chris Cormack 23111c04b0 Bug 5327 : Fixing a typo in the test that was causing a false fail
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
t/db_dependent/Items.t was failing despite valid data before patch,
works fine after
2012-09-06 12:31:05 +12:00
Robin Sheat 5a34c64b93 Bug 8594 - prevent the report system from breaking some subqueries
If you had a report query that had a subquery in the fields list, and
that subquery had a LIMIT specifier, then it would be removed which
could break your query. This patch prevents this case from breaking by
ensuring that only a LIMIT that follows the last WHERE in the query is
removed.

If you don't have a WHERE, then it will behave like it always
did, removing all the cases of LIMIT (which would still break a subquery
but this is a) more rare, and b) would require more intelligent parsing
to deal with.

Also adds test cases and function documentation.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Tested with this report:

select biblionumber, (select itemnumber from items where items.biblionumber=biblio.biblionumber LIMIT 1) from biblio where biblionumber<1000;

and it worked like a charm

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-09-06 11:05:15 +12:00
Chris Cormack 8d3e82e03e Bug 8486 - Follow up making the tests db independent 2012-07-28 20:07:36 +12:00
Colin Campbell e52ff95d9b Bug 8486 Correct calculation of days_between`
This patch backports the following patches
from master to 3.8.x:

commit d786d7c7b6c2894cca6231cae3deee9c9d43120b
Author: Colin Campbell <colin.campbell@ptfs-europe.com>
Date:   Tue Jul 24 15:16:10 2012 +0100

    Bug 8486 Correct calculation of days_between

    There were errors in the calculation used for days_between
    which caused incorrect values to be returned
    Added tests to validate calculation

    NB Tests still need to be provided for the hourly
    calculations

commit 8379a9781dbf16bcb53b55b20f15dcd55ff948Oc2
Author: Colin Campbell <colin.campbell@ptfs-europe.com>
Date:   Wed Jul 25 10:55:56 2012 +0100

    Bug 8486 Merge Calendar test files

    Moves the tests previously in t/Kalendar.t to t/Calendar.t
    and removes the old file.
    Note the existing minimal test of C4/Calendar still called in
    t/Calendar

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-07-28 14:48:33 +12:00
Chris Cormack f6e238b410 Bug 5644 : Fixing the test
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-07-17 17:39:47 +12:00
Jared Camins-Esakov 4e2b90506d Bug 8383: Add test to check that Perl scripts compile
This patch adds t/db_dependent/00-strict.pl which tests that all Perl
scripts compile. I chose to use Test::Strict so that in the future we
can also have the test check that "use strict" and "use warnings" are
enabled.

To test:
1. Run t/db_dependent/00-strict.pl.
2. Run around waving your arms in the air that we have a couple of
   scripts that don't compile.
3. Actually, that's about it. You could test my patch for bug 8384 next.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Moved test to t/db_dependent

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Conflicts:

	C4/Installer/PerlDependencies.pm
2012-07-11 08:49:19 +12:00
Stacey Walker a44b3652d2 bug 5327: added some tests for C4/Items.pm
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-07-07 09:29:32 +12:00
Colin Campbell ef6444e302 Bug 8216: Allow SIP modules to pass critic tests
Add C4/SIP to perlcritic tests. Fix those issues that were
generating perlcritic errors

Signed-off-by: Stacey Walker <stacey@catalyst-eu.net>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-06-22 20:12:43 +12:00
Dobrica Pavlinusic 7526cc1042 Bug 7952 - followup to fix t/Creators.t
Since we are now using temporary file, we are creating test.pdf
at end of test and checking if it exists and have non-zero size.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-06-16 06:58:26 +12:00
Chris Cormack 03bf55aeb8 Bug 5327 : Fix for XISBN test, thingisbn is now handing back different results 2012-06-06 08:58:03 +12:00
Srdjan a5c185fd53 bug_8056: sorted out slip print calls
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
preference works as expected.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Tested that CircAutoPrintQuickSlip clear the screen still works well

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-05-29 08:57:25 +12:00
Paul Poulain 6eb021ab0e Merge remote-tracking branch 'origin/new/bug_5347' 2012-04-19 11:53:44 +02:00
Chris Cormack d83a71d8e6 Bug 5347 Follow up, fix for broken test 2012-04-19 11:40:02 +02:00
Paul Poulain 1ee7f449be Merge remote-tracking branch 'origin/new/bug_5347' 2012-04-18 17:02:25 +02:00
Ian Walls ff29f978af Bug 5374 [SIGNED-OFF] Followup: adds conditional check to unit test for late orders
If there are no late orders in the database, the 5th unit test for C4/Acquisition.pm
fails, since no date is returned (and today's date is expected)

This patch adds a conditional check around whether any late orders are actually returned
by GetLateOrders. If so, tests proceed, if not, they're skipped.  This seems to quiet
the failures in the automated test suite.

http://bugs.koha-community.org/show_bug.cgi?id=5347

signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-04-18 17:01:24 +02:00
Paul Poulain 1acf7a1fad members now passes perlcritic, but not misc. removing testing of misc 2012-04-10 18:03:55 +02:00
Mason James 7eef4c8c70 Bug 5668 - Star ratings in the opac
patch applied to commit eb3dc448d2

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Turned on star ratings in the opac on details and results
Searched for titles - saw the stars
Clicked on a title
Clicked on the stars
Clicked on the stars to change my rating
Logged out
Tried to click on stars
Logged in as different user
Rated items that were rated already and saw average change
Changed preference to show only on detail and repeated tests
Changed preference to now show stars

All above tests passed. Signing off.

Rebased 3-19-12 by Ian Walls

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-10 14:40:49 +02:00
Chris Cormack 7f2ab970da Bug 6679 :[SIGNED-OFF] members dir now passes perlcritic tests
signed-off-by Jonathan Druart <jonathan.druart@biblibre.com>
2012-04-10 13:44:53 +02:00
Srdjan 12ff7355bb bug_7613: OCLC Connexion gateway
svc/import_bib:
* takes POST request with parameters in url and MARC XML as DATA
* pushes MARC XML to an impoort bach queue of type 'webservice'
* returns status and imported record XML
* is a drop-in replacement for svc/new_bib

misc/cronjobs/import_webservice_batch.pl:
* a cron job for processing impoort bach queues of type 'webservice'
* batches can also be processed through the UI

misc/bin/connexion_import_daemon.pl:
* a daemon that listens for OCLC Connexion requests and is compliant
  with OCLC Gateway spec
* takes request with MARC XML
* takes import batch params from a config file and forwards the lot to
  svc/import_bib
* returns status

ImportBatches:
* Added new import batch type of 'webservice'
* Changed interface to AddImportBatch() - now it takes a hashref
* Replaced batch_type = 'batch' with
  batch_type IN ( 'batch', 'webservice' ) in some SELECTs

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
2012-04-06 17:26:20 +02:00
Paul Poulain 2bc542789f Merge remote-tracking branch 'origin/new/bug_7284' 2012-04-04 18:18:26 +02:00
MJ Ray 9d65f66536 bug 7284: fix package build problem, move BEGIN into new
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-04-04 18:18:12 +02:00