Commit Graph

294 Commits

Author SHA1 Message Date
Liz Rea baf6d27040 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>
(cherry picked from commit 0668963124)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 23:33:10 -05:00
Chris Cormack b444177688 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>
(cherry picked from commit 28c00dd146)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 23:21:45 -05:00
Srdjan Jankovic 1430e4a987 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>
(cherry picked from commit da99978777)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 23:11:51 -05:00
Duncan Tyler c6fe08496d 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>
(cherry picked from commit 4e64d14700)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 23:11:11 -05:00
Liz Rea 984c0a7115 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>
(cherry picked from commit 3a42ff5d67)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 15:31:01 -05:00
Paul Poulain 74a213b215 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>
(cherry picked from commit 2f95419c36)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 15:24:46 -05:00
Duncan Tyler d009946081 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>
(cherry picked from commit caf02e8dca)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 15:24:20 -05:00
Chris Hall a10d4f71e5 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>
(cherry picked from commit 31efcea6ca)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 15:24:06 -05:00
Chris Hall bb28932d0e 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>
(cherry picked from commit c8f04b8e7b)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 15:23:39 -05:00
Duncan Tyler 0867625a1d 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>
(cherry picked from commit fc2a6415a9)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 15:23:13 -05:00
Duncan Tyler a25a43c88c 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>
(cherry picked from commit b418a16623)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 15:22:59 -05:00
Duncan Tyler 252aab52be 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>
(cherry picked from commit 3aa19f2186)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2012-01-20 15:22:45 -05:00
Chris Cormack 201f4ee4fe 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>
2012-01-18 13:06:01 -05:00
Chris Nighswonger b253e07fca Bug 7095: Fixing cut and paste error and removing the use of diag() as this does not produce output when the test is run in a harness
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit a340ded2ca)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-11-19 21:07:08 -05:00
Srdjan Jankovic b340aa213e bug_5533: Improved marking items as lost
Call LostItem() whenever an item is lost
Disable lost status on catalogue item edit

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-10-25 19:54:56 -04:00
Srdjan Jankovic a82959ed04 bug_6253: Unified member Search()
Removed SearchMembers() and replaced with more generic Search()
Amended Search() to try cardnumber first
Replaced SearchMembers() calls with Search()
Replaced SELECT with Search() where appropriate
C4::SQLHelper:
- added support for '' key for search filter.
- when passing an array to filter, join with OR (rather than AND)
- added support for key => [val1, val2] in filter
- did not document - there was no input documentation to start with,
  and SQLHelper should be replaced with something better anyway

Signed-off-by: Liz Rea <lrea@nekls.org>
(again - testing merge issue)
The functionality of the patch seems to be maintained with Biblibre's changes.

I tested the following:
Extended attribute searching: works
3 part name searching: works
2 part name searching: works
1 part name searching: works

From:
mainpage.pl
members-home.pl
	Patron search limited by branch: Works
	Patron search limited by patron category: works
	Ordering by cardnumber instead of surname: works
The "Check Out" field in the masthead.

Circ Autocomplete is not reliably functional at this time, but the problem appears to predate this patch.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 18b8991cf1)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-10-25 19:32:30 -04:00
Paul Poulain 54ce3fde2b Bug 7034: de-nesting C4/Branch.pm
use C4::Koha was loaded only to call C4::Koha::get_infos_of in get_branchinfos_of

the sub get_branchinfos_of was used nowhere
(checked with "grep -R get_branchinfos_of *")
only one reference was made to get_branchinfos_of, in reserve/request.pl, but the sub was not used in fact (maybe removed previously & silently)

This patch removes sub get_branchinfos_of and use C4::Koha in C4::Branch, as well as the reference in request.pl and the t test

The patch doesn't remove use C4::Branch in reserve/request.pl, as it's still used for other subroutines.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 69732f5c62)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-10-25 19:25:36 -04:00
Chris Cormack 459c3c7b76 Fixing a broken test
(cherry picked from commit 7244d5060b)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-10-08 12:52:54 -04:00
MJ Ray 2afee7b84a Bug 6460: alternative fix, updating template and script instead of C4::Log
Add some test cases and fix a bug in C4::Log found by in review.
Thanks-to: Katrin Fischer.

Signed-off-by: Liz Rea <lrea@nekls.org>
Passes test, interface works as expected.

Signed-off-by: Liz Rea <lrea@nekls.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit a746e11c14)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-10-08 12:47:44 -04:00
Chris Cormack c3a3d3ad24 Bug 6679 : Enable Critic tests for authorities and fixed resulting warnings
Signed-off-by: Ian <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit e1bb9e5137)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-10-08 12:44:15 -04:00
Chris Cormack 3ca4d242d0 Bug 6679 Fix scripts in admin & acqui to pass Perl::Critic
Scripts in admin & acqui subdirectores weren't passing t/00-testcritic.t. This
patch add admin & acqui scripts to test case and fix various errors related to
Perl::Critic compliancy.

- Fixing a style error to pass Perl::Critic, plus silencing a warn
- More style errors, plus fixing a security issue
- Explicitly using Carp

Contrary to common belief, subroutine prototypes do not enable
compile-time checks for proper arguments. Don't use them.

Defining a named sub within another sub, does not prevent that
subroutine being global

Signed-off-by: Frédéric Demians <frederic@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 7cdea5de35)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-10-08 12:16:39 -04:00
Galen Charlton ee02c805fc bug 5653: use itemcallnumber in bib label layouts
The sample bib label layouts and the hard-coded default
format_string for new layouts used 'callnumber' when they
should have used 'itemcallnumber', preventing call numbers
from being printed on spine labels that use the system-supplied
layouts.  Besides correcting the sample data, this patch
now also enshrines 'callnumber' as an alias for 'itemcallnumber'.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
After applying patch it works for new and old layouts (itemcallnumber and callnumber).

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit d2f49e1976)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-06-13 20:59:37 -04:00
Jared Camins-Esakov 905d24a9e0 Add unit tests to ensure bug 5683 doesn't reappear
Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
(cherry picked from commit d949472324)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
2011-06-03 15:06:01 -04:00
Colin Campbell d8b362e0f9 Bug 5415 Let calls of SimpleSearch utilize considtent interface
Remove some unnecessary checks when check of error is
sufficient. Make the order in some cases more logical
Should remove some possibilities of runtime warning noise.
Although some calls belong to the 'Nothing could
ever go wrong' school have added some warnings

Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-08 13:52:57 +12:00
Frédéric Demians b9cee99da4 Bug 5065 Add ability to choose framework on import
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-21 20:36:35 +13:00
Julian Maurice b1e3b6753e Follow up for bug 5880: Improved unit test
The unit test Koha.t now skip tests of the two subroutines if the insert
query failed.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-18 09:10:43 +13:00
Julian Maurice 1eb9d9e581 Follow up for bug 5880: Added unit tests for the two new subroutines
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-18 09:10:40 +13:00
Colin Campbell 5f7b1a58f0 Bug 5485: Add script to run Test::Perl::Critic
Tests are run if TEST_QA environment variable is set
and Test::Perl::Critic is installed
e.g.
TEST_QA=1 prove =l t/00-testcritic.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-17 12:35:58 +13:00
Chris Cormack 8215cc8bad Bug 5595 : Fixing a security glitch (please always use placeholders or
dbh->quote and fixing the tests
2011-03-13 20:30:13 +13:00
Colin Campbell 0d082204ea Bug5063: C4::Bookseller Changes
Merge unfao changes to C4::Bookseller
Enable warnings in Bookseller.pm
Some cleanups in Bookseller code
Do not export everything by default
Display vendors more rationally
    Was displaying by id make it name as the searchstring is for all
    embedded substrings
Have removed "if mysql" logic as we want to deal with this by
    abstracting the DB interaction and it makes cleaner code until then

Sponsered by UN FAO, Rome

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-12 08:42:26 +13:00
Robin Sheat 9df2a4a8fc Bug 5477 [SIGN-OFF] Fix test cases that require database access
This moves the DB-requiring tests out of the way, with the exception of
00-load.t which is used by the git hooks. For it, it makes it skip
loading problematic modules. This allows 'make test' to complete successfully
without a database configured, wich is a required part of making packages.

This has been tested against the v3.02.03 tag and the master branch.

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-29 17:02:31 +13:00
Chris Cormack d64008644a Bug 5327 fixing missing number of tests 2011-01-21 11:28:58 +13:00
Zach Sim 5f0f2e297a Added more unit tests to check when JSONStream should fail.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-21 10:57:00 +13:00
Zach Sim 434d9a3c66 Bug 5327: Added unit tests to Output_JSONStream.t
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-21 09:52:17 +13:00
Chris Cormack 1c89ce34b9 Bug 5327: small typo in the Members.t test 2011-01-20 20:14:04 +13:00
johnboy 669280c7ab Bug 5327 Made test file for Accounts.pm
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-20 19:57:50 +13:00
Chris Cormack 314772637c Bug 5327: Shifting and little tidy up of the members tests 2011-01-20 11:53:06 +13:00
johnboy d567945517 Bug 5327 Some tests added
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-20 11:33:01 +13:00
Chris Cormack e03026adff Bug 5327 - Now we are doing db calls, we need to shift this to t/db_dependent 2011-01-19 13:38:52 +13:00
Zach Sim b56121db02 Added unit tests to test all of get_amazon_tld in Amazon.pm.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-19 13:38:15 +13:00
Chris Cormack 73f0857003 Merge remote branch 'kc/new/bug_5327' into kcmaster 2011-01-19 11:26:18 +13:00
Chris Cormack 23f92a8f8d Bug 5327: Little change to Record.t 2011-01-19 11:24:24 +13:00
johnboy 5aa8040875 Bug 5327 1 more test added.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-19 11:04:37 +13:00
Zach Sim 65e2cda8d2 Added unit tests for Biblio and moved it to db_dependent as it requires the database.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-19 11:03:19 +13:00
Chris Cormack 22e5f27ff4 Merge remote branch 'kc/new/bug_5327' into kcmaster 2011-01-18 22:54:06 +13:00
Chris Cormack 4093615e9f Bug 5327 Cleaning up XISBN.t a bit 2011-01-18 22:52:02 +13:00
Chris Cormack 6c0b51460e Merge remote branch 'kc/new/bug_5327' into kcmaster 2011-01-18 19:55:12 +13:00
Chris Cormack 71a7d2ad38 Bug 5327 - Fixing a path issue with XISBN.t 2011-01-18 19:53:58 +13:00
Chris Cormack c8ba99e155 Bug 5327 litte fix for Background tests 2011-01-18 16:35:08 +13:00
Chris Cormack eff21765f9 Bug 5327 shifting database dependent modules and scripts to t/db_dependent 2011-01-18 16:18:37 +13:00