Commit graph

270 commits

Author SHA1 Message Date
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
johnboy
cc039cdb0f bug 5327 updated test file
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 16:08:11 +13:00
Zach Sim
52762c6c79 Added unit tests using a test database for XISBN.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 16:04:15 +13:00
Zach Sim
f2d575c92c Created unit testing using the testdatabase for XISBN.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 16:03:11 +13:00
Zach Sim
3b22fc6cc0 Added extra unit tests to Debug.t
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 11:59:07 +13:00
johnboy
80f8c41e4c bug 5327 started testing
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 11:57:08 +13:00
johnboy
594a31bfe1 Bug 5327 Starting tests for BackgroundJob
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 11:56:48 +13:00
spartaness
3df717479c Bug 5327 Starting Unit Tests for Auth.pm
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 11:33:27 +13:00
claudia
81f9c4976c Bug 5327 removing uneeded tests
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 09:10:26 +13:00
Zach Sim
53a301b8f2 Bug 5327 - Adding UNIT Tests.
Squashed commit of the following:

commit 146d14665c52edaa85e38b70aabc9d52be5d64b6
Author: Zach Sim <joseph.zachariah.sim@gmail.com>
Date:   Mon Jan 17 16:07:24 2011 +1300

    Edited DisplayISBN to cleanup the ISBN using _isbn_cleanup if it is not 13 or 10 digits long.

commit ba97b26d9a25470b0717cdd60a3d4f7a5c459ca9
Author: Zach Sim <joseph.zachariah.sim@gmail.com>
Date:   Mon Jan 17 16:06:14 2011 +1300

    Added extra unit tests to test C4::Koha::DisplayISBN.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-17 16:25:08 +13:00
Colin Campbell
073fb1aee6 Bug 5611 Tidy up C4::Scrubber
Remove the unneeded package variables
Remove unnecessary variables
Removed some cargo-cult programming
Tidied the indentation from mix of tabs & spaces
Add a Test that we actually return the required class
of object

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-13 06:44:46 +13:00
Colin Campbell
0d5029ec5b Bug 5601 :: Add tests for bugfix
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-12 19:30:40 +13:00
Henri-Damien LAURENT
63a8c5bc9d MT3801 followup : Cannot claim for issues
was missing an opening (
Adding test script

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2010-12-15 13:30:47 +00:00
f36747f5e8 Fix for Bug 4473 - Recent comments view for the OPAC
- modifies opac-showreviews.pl to display recent comments for all
  titles, sorted in descending order by date.
- includes RSS feed
- includes (thanks to Chris N.):

[Enhancement][3.4] Add RFC822 Format to C4::Dates

This patch adds RFC822 formatting to C4::Dates. It also updates Dates.t
appropriately. Consult the POD for this module for how to use
this format.

Please note that this module *does not* handle TZ conversion at this point.
This means that the TZ portion of a RFC822 time will be truncated and the converted
time will be in the same TZ as was passed in. When generating an RFC822 time,
the local TZ offset will be included since none of the other supported formats
provide a means for including their TZ. This is not a problem introduced by the
addition of RFC822 formatting. Rather it is due to this module not having TZ
support to begin with.

Also note that the dow, moy abbreviations are English as required by
RFC822 section 3.3 (thanks to self for pointing that out).

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-13 09:43:01 +13:00
Koustubha Kale
e4cbc4f421 Bug 5418: Rev-5 patch new itemBarcodeInputFilter for libsuite8 style barcodes
In India a ILS product called Libsuite8 prints barcodes like b0007432. The barcode is not stored anywhere in libsuite8's database. Neither is barcode available in any of the reports generated by the software.

The barcode 'b0007432' when scanned into the libsuite8 software is de-constructed like 'b' which is the itemtype i.e. Book in this instance, and '7432' which is the 'Accession Number'. The software then takes the logged in staff's branchcode and does a join on three tables 'Location', 'Media_Type', and 'Books' to retrieve the particular record from the database.

There is no possibility of recreating the barcodes for insertion in Koha while doing a retrospective conversion, because of arbitrary length of the barcode string AND arbitrary number of zeros in the numeric part of the printed barcode AND the fact that there are no reports available from the software which contain barcodes AND the fact that the barcode is not stored in the database.
But most importantly due to the simple fact that printed barcodes are duplicated among branches.

Therefore this patch emulates the functionality of Libsuite8 software of converting the scanned barcode into one stored in Koha using the itemBarcodeInputFilter system preference.

To use this new itemBarcodeInputFilter systempreference choice called 'libsuite8', the barcodes stored in Koha must match the pattern of <branchcode>-<itemtype_code>-<accession_number>. This is easy to achieve while doing retrospective conversion from Libsuite8 to Koha.

As expected the itemBarcodeInputFilter will return unmodified barcode if presented with a barcode of pattern <branchcode>-<itemtype_code>-<accession_number>

This revision corrects the way updatedatabase.pl is changed in order to correctly update version and insert the libsuite8 option in the database. Also kohaversion.pl is changed in the recommended format of 3.0X.0X.XXX to reflect database has changed.

This revision also changes the erronorous itemBarcodeInputFilter description in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref from 'scanned patron barcodes' to 'scanned item barcodes' there by eliminating need for a separate patch for bug 5417.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

1) applied patch to HEAD
2) set next database number in kohaversion.pl and updatedatabase.pl
3) webinstaller kicked in, update ok
4) typed the barcodes from test cases into check-in

Barcodes used my local branch code, everything seemed ok to me.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-12 20:39:20 +13:00
Colin Campbell
78be08c73e Bug 5448 Use Test::More in Boolean.t
Use Test::More's structure as more readable
Replaced a test of an used function with a use_ok test
of the module

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-02 08:51:32 +13:00
4cef5ec961 bug 5400: new test case to find files with merge conflict markers
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-14 09:37:27 +13:00
35d2008ef0 bug 5393 [SIGNED-OFF]: add test case to check well-formedness of XML/XSLT files
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-13 11:51:49 +13:00
Colin Campbell
51eb4fa12e Bug 4305: Add test case for ISBN-13 to ISBN-10 conversion
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-13 06:43:49 +13:00
bcedff69bc bug 4305: add a couple test cases for _isbn_cleanup
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-12 10:26:57 +13:00
Chris Cormack
af1d829031 Merge remote branch 'kc/new/bug_5386' into kcmaster 2010-11-12 06:41:25 +13:00
e3322f732e bug 5386: remove dep on Path::Class from t/00-load.t
File::Spec is a core module, Path::Class isn't; not yet
worth adding a new dependency.

Also some minor whitepace cleanup.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-12 06:40:02 +13:00
Chris Cormack
235cf872a5 Merge remote branch 'kc/new/bug_5105' into kcmaster 2010-11-11 21:33:48 +13:00
5ebb5d4f4c Bug 5105 Regression test for switch statement
Add a test identifying Perl scripts and modules using switch statements.
This test file follow Chris pre-hook naming convention in order to be
triggered for patch submissions.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-11 21:32:31 +13:00
Chris Cormack
7ecf2c2dc4 Test modules compile
Script to test modules compile, when used with a pre-commit hook this
can test before a commit

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-11 21:31:02 +13:00