Commit graph

307 commits

Author SHA1 Message Date
Paul Poulain
e12fca0eb8 Merge remote-tracking branch 'origin/master' into new/bug_5327 2011-12-15 13:49:47 +01:00
Chris Hall
dfa4b73737 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>
2011-12-15 13:41:47 +01:00
Duncan Tyler
47b514cf56 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>
2011-12-15 13:41:43 +01:00
Duncan Tyler
bb79d37b87 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>
2011-12-15 13:41:41 +01:00
Duncan Tyler
7876d4fa8d 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>
2011-12-15 13:41:37 +01:00
Chris Cormack
9c66c42764 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>
2011-12-13 14:25:46 +01:00
Paul Poulain
484c1f6dea Merge remote-tracking branch 'origin/new/bug_7141' 2011-12-08 11:05:35 +01:00
Chris Cormack
ce59911932 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>
2011-12-08 10:51:25 +01:00
Chris Cormack
7dbb966b49 Bug 6679 : Allowing eval require
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-08 10:25:14 +01:00
Chris Cormack
dc6e1031f8 Bug 6679 : Adding license statement and stopping declaring variables in a conditional 2011-12-08 10:11:27 +01:00
Chris Cormack
a047dea5e4 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.
2011-12-08 10:11:23 +01:00
Paul Poulain
b9d743a928 Merge remote-tracking branch 'origin/master' into new/bug_6679
Conflicts:
	catalogue/showmarc.pl
2011-12-08 10:08:44 +01:00
Chris Cormack
4a14e7dbe6 Bug 6679: catalogue/ now passing perl critic tests
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-08 10:05:48 +01:00
Paul Poulain
e06f3ee0fa Jenkins complaining = fixing number of tests
(see jenkins build http://jenkins.koha-community.org/job/Koha_master/557/#showFailuresLink)
2011-12-07 18:04:10 +01:00
Paul Poulain
ffb544e8e4 t/UploadedFile, updated comment 2011-12-07 16:37:31 +01:00
Chris Cormack
94e1691a74 Bug 5327: Fixing the Members.t test
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Confirm Members.t tests complete
2011-12-07 16:17:11 +01:00
Chris Cormack
dbe36a2bf3 Bug 5327 : Fixing unit test for SQLHelper.pm
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Confirm that all SQLHelper tests pass.
2011-12-07 16:17:10 +01:00
Chris Cormack
19d071910f Bug 5327 : Complete coverage for BackgroundJob.pm
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests run without problems.
2011-12-07 16:17:08 +01:00
Chris Cormack
a9bbeae6cc Bug 5327 : Adding more unit tests
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
New tests run without problems.
2011-12-07 16:17:07 +01:00
Chris Hall
16c51d0376 Bug 5327: Unit tests for C4/Exteral/BakerTaylor.pm
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-12-07 16:17:05 +01:00
Maxime Pelletier
d2c101a8a9 fix test xml records
http://bugs.koha-community.org/show_bug.cgi?id=5327
2011-12-07 16:17:03 +01:00
Paul Poulain
13f29dd7f3 Test suite: ignoring backups from vi (files ending with a ~)
On my laptop, this test was failing because some scripts had a conflict marker in a backup ... of a conflict I just fixed!
ignoring any file ending with a ~
2011-12-07 15:17:54 +01:00
Ian Walls
d059079caf Bug 2346: Remove C4::Overdues::UpdateBorrowerDebarred in favour of C4::Members::DebarMember
Removes now-unused subroutine from C4::Overdues, as well as the db_dependent unit test

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-12-06 19:12:20 +01:00
Paul Poulain
d019b4c63a Bug 6328 Fixes for comment 35
* correctly indenting with tab the debarrcomment field
* setdebar.pl is called without status parameter, thus it is not working anymore. It's fixed & some dead code has been removed. To test : debar someone, then go to patron detail page and click "lift debarment"
* the test function had not been updated. The fix define a debarment date of 2099-12-31 (no limit)
2011-11-25 14:00:47 +01:00
Chris Nighswonger
a340ded2ca 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>
2011-11-18 22:51:28 +01:00
Srdjan Jankovic
18b8991cf1 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>
2011-10-19 16:23:02 +13:00
Paul Poulain
69732f5c62 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>
2011-10-19 03:23:31 +13:00
Srdjan Jankovic
4770555855 bug_5533: Slightly improved marking items as lost
Call LostItem() whenever item is lost.
LostItem() new arg - mark returned.
Disabled Lost Status on catalogue item edit.

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

For follow up we need to explain how to hide the 952$1 (lost) from
the framework by putting it in the 'ignore' tab.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-18 09:01:39 +13:00
Chris Cormack
7244d5060b Fixing a broken test 2011-09-26 11:55:58 +13:00
MJ Ray
a746e11c14 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>
2011-09-24 10:01:09 +12:00
Chris Cormack
e1bb9e5137 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>
2011-09-23 14:18:21 +12:00
Chris Cormack
7cdea5de35 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>
2011-09-21 14:56:29 +12:00
Srdjan Jankovic
54d38461f0 Bug 6721 - improve searching in the acquisitions system
This allows a basket to be searched for by name or invoice number from
anywhere in the acquisitions system. It is accessible by clicking on
"orders search", clicking the '[+]' and filling in the basket or invoice
no. fields.

Author:    Srdjan Jankovic <srdjan@catalyst.net.nz>
Author:    Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-26 11:34:27 +12:00
d2f49e1976 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>
2011-06-13 11:15:34 +12:00
Chris Cormack
7aa3a05591 Merge remote-tracking branch 'kc/master' into new/bug_5683 2011-06-02 09:02:50 +12:00
Jared Camins-Esakov
d949472324 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>
2011-06-02 08:46:40 +12: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
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