Commit graph

528 commits

Author SHA1 Message Date
99410d7ce4 Bug 9209 - Mocked Koha::Calendar tests
Using specific method for populating the internal data structures from Koha::Calendar
has yielded to the non-detection of several bugs. There are also several tests that where
db_dependent which is not always desirable.

I propose the use of DBD::Mock (::Session) for using the actual code used by Koha in production
for testing, mocking the DB queries itselves.

I also took the time to repeat several tests in different syspref configurations (they applied
only to daysMode=Calendar, and now cover all confs).

Notes:
- I used DBD:Mock 1.45 as previous version (1.43, from 12.04) was broken
- Some tests revealed a bug on days_between as I see it... reporting as Bug #9211

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-28 20:15:35 -05:00
Jared Camins-Esakov
66717192f4 Revert "Bug 7167: Adds Unit tests for C4::Update::Database"
This reverts commit 69c19e28b4.
2012-12-27 14:02:52 -05:00
Jonathan Druart
69c19e28b4 Bug 7167: Adds Unit tests for C4::Update::Database
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
2012-12-27 11:13:58 -05:00
06a1287c74 Bug 7067 - QA Followup - Fix failing tests
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-14 08:09:01 -05:00
02c562249c Bug 7067 QA Followup - Add descriptions to tests
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-14 08:09:01 -05:00
29aa50d93d Bug 7067 QA Followup
Adjusts calling conventions to use hashrefs and eliminate redundant
procedural/OO mixed code.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-14 08:09:00 -05:00
Jared Camins-Esakov
a1525b297f Bug 9191 follow-up: remove example updatedatabase stanzas
The patch for bug 9191 included example updatedatabase stanzas that
require removal before pushing. This patch also updates the
00-checkdatabase-version.t test so that it will not give
false-positives.
2012-12-11 08:29:11 -05:00
Jared Camins-Esakov
a6c7ba8519 Bug 9191: updatedatabase.pl should only run updates up to the current version
Check whether a given update should be run when passed the proposed
version number. The update will always be run if the proposed version
is greater than the current database version and less than or equal to
the version returned by C4::Context->final_linear_version (initially set
to be equal to the version in kohaversion.pl). The update is also run if
the version contains XXX, though this behavior will be changed following
the adoption of non-linear updates as implemented in bug 7167.

To test:
1) Make sure that the first example database update added by this patch
   in installer/data/mysql/updatedatabase.pl has a version number one
   greater than the version of Koha you have installed.
2) Set the Version syspref back one version behind your current version.
3) Navigate to the main page of the staff client, and log in to the
   installer.
4) Confirm that the update page claims to have rerun the previous update
   and has displayed the log message:
   "Upgrade to 3.11.00.XXX done (Bug 9191: You should see this)"
   but not the log message:
   "Upgrade to [version number] done (Bug 9191: You shouldn't see this)"

Note: the sample database revisions will be removed by the RM before
this patch is pushed to master.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
works great

Signed-off-by: Elliott Davis <elliott@test.bywatersolutions.com>
Works as expected.  Test plan is great. Code looks to be adherent to standards.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-11 08:19:00 -05:00
Jared Camins-Esakov
a090beaa80 Merge branch 'bug_8519' into 3.12-master 2012-12-08 09:45:44 -05:00
Jonathan Druart
3eec0e96ec Bug 7919: Fix unit test (Members_AttributeTypes.t)
- Reintroduce the class column in a select statement (was present before
  this development)
- FIX UT: If there are no arg passed in parameter, the routine calls
  C4::Context->userenv which call an execute statement. It consumes the
  mocked resultset

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Elliott Davis <elliott@test.bywatersolutions.com>

All tests successful.
Files=1, Tests=9,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.16 cusr  0.06 csys =  0.25 CPU)
Result: PASS
2012-12-07 18:26:37 -05:00
3a26d655ab Bug 8519 - Make koha-index-daemon run on startup
[This patch was split out from tcohen's excellent patches for bug 8519
--jcamins 2012/10/31]

Added a new koha-index-daemon-ctl.sh script that uses the
'koha-index-daemon' provided by Koha::Contrib::Tamil (install via CPAN)
to process the indexing queue ('zebraqueue' for now, 'indexqueue' in the
future I guess :-P).

This script could be easily modified in the future for using another
index queue processing script (a more abstract indexing script for both Solr
and Zebra, etc). I removed all zebra-ish stuff from it.

Documentation patches will be provided as followups, once Mark Tompsett's
docs are pushed to avoid continous rebasing.

Tested to work on an up-to-date Ubuntu 12.04.

Sponsored-by: Universidad Nacional de Córdoba

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-07 09:19:18 -05:00
18b83eedd3 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>
2012-11-28 07:19:34 -05:00
7b18e2146c 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>
2012-11-22 09:11:19 -05:00
Jared Camins-Esakov
3b8a750ee2 Merge branch 'bug_9039' into 3.12-master 2012-11-12 20:06:31 -05:00
Chris Nighswonger
0f65d04659 Bug 9039 - Tests in the basic test suite should only test code based on required dependencies/modules
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-12 20:03:40 -05:00
Jared Camins-Esakov
3ce177263b Bug 9054: 00-load should not try to load modules with optional dependencies
Prior to this patch, t/00-load.t was trying to load Koha::SearchEngine,
which fails when Moose is not installed.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-12 18:43:16 -05:00
Jared Camins-Esakov
8263f5bdb4 Merge branch 'bug_9036' into 3.12-master 2012-11-12 18:40:00 -05:00
Chris Nighswonger
2fda5d04c1 Bug 9036 - 00-load.t checks Koha::Cache::Memcached when it should not this patch adds code to skip this module during this test
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-12 18:39:36 -05:00
Christopher Nighswonger
78b1721144 Bug 7119 - tidy t/00-load.t
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-12 18:39:04 -05:00
Jared Camins-Esakov
4b65389d5e Bug 9005: Allow user to disable syspref cache
Because C4::Context uses an in-memory hash for caching sysprefs,
changing a syspref under a multi-threaded persistent environment
requires a server restart. This patch makes it possible disable
the syspref cache.

To test:
1) If you are using a multi-threaded persistent server (Starman, etc.),
   change a syspref and note that the effects of the syspref change may
   or may not be visible on any given request before applying this patch.
   You will need to choose a syspref with obvious effects that can be
   seen by simply refreshing the page. I recommend enabling or
   disabling additional languages in the OPAC, since you can refresh the
   page a dozen times and reasonably expect to see the new behavior you
   set only 1/n of the time.
2) Apply patch.
3) Add "C4::Context->disable_syspref_cache();" to your koha.psgi file
4) Repeat step 1, noting that you never see the stale behavior.
5) Run test at t/db_dependent/Context.t.

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

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-08 12:41:10 -05:00
44c3657cfc Bug 9001: Remove Zebraqueue_daemon
[This patch was split out from tcohen's excellent patches for bug 8519
 --jcamins]

It removes the obsolete zebraqueue_daemon.pl and koha-zebraqueue-ctl.sh
obsolete scripts too.

Several files are modified to address te removal/addition of these files.

I didn't run the install procedure as I was working on my laptop with a dev
setup, just set the symlinks. Now fixed things as proposed by wajasu
on comment #4. Any other suggestion please let me know.

Tested to work on an up-to-date Ubuntu 12.04.

Asked by wajasu, remove remaining obsolete zebraqueue stuff.

Sponsored-by: Universidad Nacional de Córdoba

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Passed-QA-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-06 16:41:11 -05:00
Jared Camins-Esakov
f352b05610 Bug 8846 conflict resolution: correct path
The test was moved since the original patch was written, making the
revised test fail. This patch corrects the mocked template patch so that
the test will pass.

To test:
1) Before applying patch, run
   `prove t/db_dependent/SuggestionEngine_ExplodedTerms.t`
2) Note that it fails.
3) Apply patch.
4) Run `prove t/db_dependent/SuggestionEngine_ExplodedTerms.t`
5) Note that it passes.
6) Celebrate.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-11-01 08:41:30 -04:00
Jared Camins-Esakov
e2a702653d Bug 8846: Exploded Terms test sneakily uses database
Even though there is no need for anything stored in the database for the
test, C4::Templates requires the database and a koha-conf.xml. The
solution is to mock all database- and koha-conf-using routines.

To test:
1) Stop MySQL
2) Unset KOHA_CONF
3) Run test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-01 08:41:29 -04:00
Maxime Pelletier
5c7fae8e89 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>
2012-10-29 18:27:04 +01:00
Robin Sheat
2b72cc9c21 Bug 8890 - move two more db dependent tests
* t/AuthoritiesMarc.t
* t/SuggestionEngine_ExplodedTerms.t

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-10-24 17:52:42 +02:00
Jared Camins-Esakov
7ee042f125 Bug 8890: don't try to load DB-dependent modules
C4::Members::Statistics uses the database in its BEGIN {} block,
which breaks the package build process. This patch causes it to be
skipped in the 00-load test.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-10-24 17:52:39 +02:00
Paul Poulain
56553964a6 Bug 8652 follow-up adding more tests
Adding 3 tests to check for the new parameter of output_pref sub
the 3rd parameter, if 1, result in only returning the date (not the time)
2012-10-09 11:47:37 +02:00
wajasu
0a35b2671a Bug 8728 : Adjust Reserves.t test for resdate and expdate and test setup/teardown
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Works better now, creats biblio records, and cleans up after itself as
well.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-10-02 18:09:27 +02:00
Robin Sheat
79e0fb6fd6 Bug 7642 - 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.
2012-10-01 17:38:27 +02:00
eba713b583 Holidays Test Plan - DB Dependent
This test file is meant to be used with the sample database
with a minimum of the sample libraries and sample holidays installed.

http://bugs.koha-community.org/show_bug.cgi?id=8110
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-10-01 16:44:02 +02:00
Paul Poulain
3e13110191 Merge remote-tracking branch 'origin/new/bug_8209' 2012-10-01 16:39:52 +02:00
Jared Camins-Esakov
25f6ba2447 Bug 8209 follow-up: another correction for BuildSummary API
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-10-01 16:37:43 +02:00
Jared Camins-Esakov
52f54eec1d Bug 8726 follow-up: fix QA issues
Fixes several perlcritic complaints, and some overflow in the
configuration page. Also notes that Did You Mean is not yet
enabled on the staff client.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Sorry about the problematic last attempt at uploading. I missed a
patch when squashing. It is now included.
2012-09-28 17:14:15 +02:00
Jared Camins-Esakov
d2cd2e09aa Bug 8726: ExplodedTerms suggestion plugin (functionality)
When working with hierarchical subject headings, it is sometimes helpful
to do a search for all records with a specific subject, plus
broader/narrower/related subjects. This patch adds a suggestion plugin for
these "exploded" subject searches to Koha. Note that this patch depends on
both bug 8211 AND bug 8209.

To test (NOTE: this test plan covers both 8211 and 8726):
1) Make sure you have a bunch of hierarchical subjects. I created
   geographical subjects for "Arizona," "United States," and "Phoenix,"
   and linked them together using 551s, and made sure I had a half
   dozen records linking to each (but not all to all three).
2) Do a search for su-br:Arizona (or choose "Subject and broader terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona" and the
   records with the subject "United States"
3) Do a search for su-na:Arizona (or choose "Subject and narrower terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona" and the
   records with the subject "Phoenix"
4) Do a search for su-rl:Arizona (or choose "Subject and related terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona," the
   records with the subject "United States," and the records with the
   subject "Phoenix"
5) Ensure that other searches still work (keyword, subject, ccl,
   whatever)
6) Use "Did you mean?" page in admin section to enable ExplodedTerms
   plugin
7) Do a keyword search on the OPAC, confirm that searching for exploded
   terms is suggested.
8) Do a subject search on the OPAC, confirm that searching for exploded
   terms is suggested.
9) Do a non-keyword, non-subject search on the OPAC, confirm that
   searching for exploded terms is NOT suggested.
10) Disable ExplodedTerms plugin and enable AuthorityFile plugin.
11) Do search on OPAC, confirm suggestions are made from authority file.
12) Sign off

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Split into two patches. This patch includes only the functionality.
2012-09-28 17:08:21 +02:00
Paul Poulain
bee6c8136f Bug 5335 follow-up fix test
The gst column is now called gstrate.
2012-09-28 11:19:56 +02:00
Jared Camins-Esakov
83370c519c Bug 8523: Display auth hierarchies w/all marcflavours
This commit adds support for displaying authority hierarchies for all
flavours of MARC, not just UNIMARC. Display now uses the jQuery
jstree plugin, selected with the help of Owen Leonard, resulting in a
much faster experience for users.

Be aware that the jstree file uses tabs rather than 4-space indentation,
which I left as-is so as to make it easier to integrate upstream
releases in the future.

To test:
1) Enable the AuthDisplayHierarchy syspref
2) Create authority records with a hierarchy of see also fields
   (in MARC21/NORMARC, you'll be using 5xx fields for this, with a
   subfield $w=g for broader terms and subfield $w=h for narrower
   terms)
3) View the authorities in the OPAC, noting the hierarchical view at
   the top of the page.

This initial patch does not create bidirection linkages from
unidirectional links in MARC21 authorities. This means that when moving
up the authority hierarchy, lower levels will disappear. This is
intentional, as the first patch is intended merely to ensure that
AuthDisplayHierarchy functions the same for all marcflavours. A future
patch will add a cron job to generate the bidirectional linkages, once
we are sure that the hierarchy functionality for UNIMARC and
MARC21/NORMARC coexists peaceably.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Resolved conflicts in updatedatabase.pl, sysprefs.sql and in one of
the CSS files.

Test plan:

1) Run t/AuthoritiesMarc.t
New tests complete without any errors.

2) Make sure updatedatabase works correctly.
Update works nicely, new system preference is also added to syspref.sql

3) Make sure new terms are translatable.
Created new po files for de-DE and checked for new terms.
All translations appear correctly.

4) Make sure everything works with AuthDisplayHieararchy OFF
- Add authority
- Edit authority
- Delete authority

5) Test feature with AuthDisplayHieararchy ON
- Add authority
- Edit authority
- Delete authority

6) Add a couple of hierarchically linked authorities
Note: links have to be created in both directions

Example:
151 $aGermany
  551 $a Baden-Württemberg $w h

151 $aBaden-Württemberg
  551 $a Konstanz $w h
  551 $a Germany $w g

151 $aKonstanz
  551 $a Baden-Württemberg $w g
  551 $a Fürstenberg $w h
  551 $a Paradies $w h

151 $a Fürstenberg
  551 $a Konstanz $w g

151 $a Paradies
  551 $a Konstanz $w g

Tree shows up nicely above the authority record
- in staff
- in OPAC
  - on the normal view tab
  - on the MARC view tab

7) Checking the logs for warnings
- no Javascript errors or warnings
- no warnings or errors in log files
2012-09-21 14:52:08 +02:00
Jonathan Druart
d7faf087a3 Bug 5335 - More granular VAT
Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Larry Baerveldt <larry@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-20 18:09:53 +02:00
Julian Maurice
766b267b15 Bug 5339: Unit tests for invoices related subroutines
These tests use DBD::Mock to check if SQL queries are correctly built.
Actually, we only check bound parameters.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-20 09:46:59 +02:00
Julian Maurice
766e2b0106 Bug 5339: Fix t/db_dependant/Acquisition.t 2012-09-20 09:45:39 +02:00
Jared Camins-Esakov
4feb6a4736 Bug 8211: Add exploded search options
When working with hierarchical subject headings, it is sometimes helpful
to do a search for all records with a specific subject, plus
broader/narrower/related subjects. This patch adds support for these
"exploded" subject searches to Koha.

To test:
1) Make sure you have a bunch of hierarchical subjects. I created
   geographical subjects for "Arizona," "United States," and "Phoenix,"
   and linked them together using 551s, and made sure I had a half
   dozen records linking to each (but not all to all three).
2) Do a search for su-br:Arizona (or choose "Subject and broader terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona" and the
   records with the subject "United States"
3) Do a search for su-na:Arizona (or choose "Subject and narrower terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona" and the
   records with the subject "Phoenix"
4) Do a search for su-rl:Arizona (or choose "Subject and related terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona," the
   records with the subject "United States," and the records with the
   subject "Phoenix"
5) Ensure that other searches still work (keyword, subject, ccl,
   whatever)
6) Sign off

Technical details:
This patch adds a shim in front of C4::Search::buildQuery in order to
preprocess the query and call the _handle_exploding_search callback.
This shim will allow us to gradually offload query parsing to a new
query parser module.

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 15:20:48 +02:00
Colin Campbell
bf79b889f0 bug 8768 correct an error in ItemType.t
The second test in ItemType.t tests that an empty table
returns no rows however as Mock::DBD has no resultset
it fails with an error in DBI It requires that an
empty resultset is defined in Mock::DBD first
This patch adds that mocked empty table

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-15 07:20:08 +02:00
Jared Camins-Esakov
bc05b5d163 Bug 7417: Include see from references in bibliographic searches
This patch adds the Koha::Indexer::RecordNormalizer and
Koha::Indexer::MARC::RecordNormalizer::EmbedSeeFromHeadings packages
to enable the inclusion of alternate forms of headings in bibliographic
searches. When the new syspref IncludeSeeFromInSearches is turned on
(default is off) rebuild_zebra.pl will insert see from headings from
authority records into bibliographic records when indexing, so that a
search on an obsolete term will turn up relevant records.

To test:
1) Enable IncludeSeeFromInSearches
2) Add a heading that has an alternate form to a record (for example,
   "Cooking" has the alternate form "Cookery," if you have authority
   records from LC)
3) Index the zebraqueue (or reindex if you haven't indexed your system
   yet)
4) Confirm that if you search for "Cookery" you get the record you
   just modified

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 5 August 2012
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 11 September 2012

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Also checked:
- Verified database update works correctly
- Checked system preference and its description
- Checked staff/opac detail pages with feature on/off
- Checked staff/opac search facets
- Downloaded and tested records in various formats
- Tried different searches for 'see from' entries of authorities
- Ran all unit tests

No problems found.
2012-09-13 14:19:28 +02:00
Galen Charlton
2904fc0752 bug 8649: quiet a variable use warning
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 11:55:51 +02:00
Galen Charlton
574becb11a bug 8649: create a temp directory for Zebra for C4::Search tests
The Zebra test uses Unix-domain sockets, which won't work if
Koha is being installed or tested from an NFS- or SSHFS-mounted
clone.  Therefore, create (and clenaup) a temporary directory on
(hopefully) a normal filesytem to run the test.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:48 +02:00
Galen Charlton
6a82961a11 bug 8649: make sure we can exit if a test fails
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:47 +02:00
Galen Charlton
7e1fdcdf37 bug 8649: make sure C4::Context is fully mocked-up before tests
This fixes failures of the test cases to run for me
on Perl 5.10.1 using prove -v t/db_dependent/Search.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:45 +02:00
Jared Camins-Esakov
f9980f6b31 Bug 8649: Add unit test for C4::Search
This patch adds a unit test for C4::Search in t/db_dependent. In order
to test the functioning of the Zebra search, this patch actually includes
an entire Zebra sandbox, and pre-indexed files, which are stored in
t/db_dependent/data (the configuration files are generated on the fly).

This test depends on Test::Warn, Test::MockModule, and DBD::Mock.

To test:
1) Run the test. There should be no failures, and no warnings.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:39 +02:00
Jared Camins-Esakov
8471158160 Bug 8209: "Did you mean?" from authorities
One of the ideas behind authority records is that users who search for
one term should have related terms (according to the authority file)
suggested to them. At the moment, Koha doesn't do that. Adding an
authority searching step to regular searches and displaying any
suggestions in a "Did you mean" bar at the top of the results would be
very useful.

This commit adds a Koha::SuggestionEngine class which is in charge of
getting suggestions from individual suggestion engine plugins, which
much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend
Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously
using AJAX, and a link to a page with suggestions is provided for users
with Javascript turned off.

The AuthorityFile suggestion engine plugin looks up the specified search
terms in the authority file and then suggests searches for records using
matching authorities.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased 2 August 2012 and incorporated QA feedback

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Test plan:
- Verified database update added system preference correctly,
  pref defaults to OFF
- Verified search results and detail pages in OPAC and staff
  still worked the same as before
  * for no results
  * with results
- Activated system preference and tested various searches
  * Searches from simple search
  * Searches from advanced search
  * Search links in records
- Deactivated Javascript - verified fallback works correctly

Notes:

- Suggested terms can include autorities with no linked records.
- When combining more than one search option using advanced search
  this results in "no suggestions" more often. Feature works best
  from simple search.

Overall great feature making use of authorities in a user friendly way!

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master 2012-09-10
Signed-off-by: wajasu <matted-34813@mypacks.net>
2012-09-13 11:34:28 +02:00
Srdjan
86c2c4626d bug_5911: Transport Cost Matrix
Create transport_cost table,  added UseTransportCostMatrix syspref.
transport_cost table contains branch to branch transfer
costs. These are used for filling inter-branch hold transfers.

Moved GetHoldsQueueItems() from .pl to HoldsQueue.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-12 14:49:25 +02:00
Paul Poulain
8449b14dcb Revert "Bug 8089: Use Koha::Cache for all caching"
This reverts commit 215abc8024.

The 3 patches for bug 8089 have been reverted, because they break
jenkins & Koha.
A follow-up has been provided, but it does not solve the problem on my
test server, it just changes the error message.

After a discussion with jared, Dobrica should work on another patch, so
the best option is to revert.
2012-09-12 14:12:41 +02:00
Jared Camins-Esakov
215abc8024 Bug 8089: Use Koha::Cache for all caching
1. Replace all instances of memoize_memcached with appropriate calls
into Koha::Cache:
* reports/guided_reports.pl
* C4::Biblio::GetMarcStructure
* C4::Languages::getFrameworkLanguages
* C4::Languages::getAllLanguages
* C4::SQLHelper::GetPrimaryKeys
* C4::SQLHelper::_get_columns

2. Replace all references to memcached with the appropriate calls into
Koha::Cache in C4::Context.

Test plan :
* have DEBUG env set to 1
* reach addbiblio page to test the patch in Biblio.pm, or setup more than 1
  language
* you should see in the logs that you're reading and writing from cache
* run the test suite twice both with and without the following environment
  variables set:
export MEMCACHED_SERVERS=127.0.0.1:11211
export MEMCACHED_NAMESPACE=KOHA
export CACHING_SYSTEM=memcached

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

I'm unsure about some of the caching times 10000 is a long long time,
but other than that, works fine.
2012-09-07 16:28:29 +02:00
Bart Jorgensen
2c8f6399b0 Bug 5327: Testing c4 Images
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
tested the 9 previous patches, that introduces many new unit tests using
the Mock Module.
2012-09-07 14:42:18 +02:00
Bart Jorgensen
92f8480d16 Bug 5327: Unit tests for C4 socialdata
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-09-07 14:32:00 +02:00
Chris Cormack
2b73673176 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-07 14:31:59 +02:00
Bart Jorgensen
4e88ce7eb8 Added tests to installer_perlmodules
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-09-07 14:31:56 +02:00
Bart Jorgensen
7537d65c42 Added a mock-db table and tested a line
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-09-07 14:31:55 +02:00
Bart Jorgensen
b86e77afbb Added and tested a mock-db tested a couple of features
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-09-07 14:31:54 +02:00
Bart Jorgensen
118754c653 Bug 5327 Tests for C4::Matcher
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-09-07 14:31:52 +02:00
Bart Jorgensen
4930852cca Bug 5327 : Added a few more lines of code to the ItemType.t unit test
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-09-07 14:31:51 +02:00
Robin Sheat
2341bd876a 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>
2012-09-05 10:12:06 +02:00
Jared Camins-Esakov
eb51a7346a 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>
2012-08-31 17:42:44 +02:00
Jared Camins-Esakov
a2186855b3 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>
2012-08-31 17:42:26 +02:00
Dobrica Pavlinusic
28e5427c60 Bug 6448 [2/3] Barcodes::EAN13 autoBarcode
Implement auto-incrementing EAN-13 barcodes

To make this work, C4::Barcodes::next was modified to call process_tail with
new incremented value so that process_tail can generate correct checksum.
Since process_tail is currenlty not used by any barcodes, this change is safe.

C4::Barcodes is used by addbiblio.pl when adding multiple records, while value_builder
is used in all other cases.

Test scenario:

1. prove t/Barcodes_EAN13.t

2. KOHA_CONF=/etc/koha/sites/fer/koha-conf.xml prove t/db_dependent/Barcodes.t
   this will check C4::Barcode implementataion

3. in systempreference change autoBarcode to incremental EAN-13 barcode

4. edit two items of any biblio assigning barcodes and verify that numbers
   are increasing. Have in mind that last digit is check digit, and it
   doesn't increment, but is calculated from barcode itself. Example with
   checksum in brackets: 000000086275[2], 000000086276[9], 000000086277[6]

5. Add Item and verify that it gets assigned next barcode

6. Add & Duplicate item and verify barcode increase

7. Add Multiple Copies and verify that barcode increase for each copy

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-02 18:41:44 +02:00
Dobrica Pavlinusic
089b1151f5 Bug 6448 [1/3] EAN-13/UPC-A itemBarcodeInputFilter
This filter which check validity of EAN-13 barcode and padd it with zeros
up to full 13 digit number. This will also expand 12 digit UPC-A barcodes
to EAN-13 automatically which is useful for older barcode readers which tend
to ignore first zero in EAN-13 if they have just UPC-A support.

It should be noted that EAN-13 or UPC-A product codes printed on books are not
good choice for barcodes in Koha since each item has to have unique barcode.

Test scenario:

1. prove t/Circulation_barcodedecode.t
   this checks expansion of 12 digit UPC-A to 13 digit EAN-13 and zero padding

2. in systempreferences search for itemBarcodeInputFilter and select EAN-13

3. edit one item and assign it valid EAN-13 barcode, eg. 0000000695152, check it out

4. test checkin with just 695152 to test leading zero expansion

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-08-02 18:41:40 +02:00
Paul Poulain
b2b16fb8cf Merge remote-tracking branch 'origin/new/bug_8233' 2012-08-01 13:53:43 +02:00
Jonathan Druart
dc60d22f96 Bug 8233: We can't load test on Koha::SearchEngine::*
As a temporary measure, don't try to load the search engine modules
in t/00-load.t.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-08-01 13:52:36 +02:00
Chris Cormack
d434be61e2 Bug 8486 - Follow up making the tests db independent
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Makes the test db independant by specifying the date format. Thus, there is no call to ->preference() that retrieve a systempreference
2012-08-01 12:36:56 +02:00
Paul Poulain
54f363c0a6 bug 8486 tiny follow-up, removing ` 2012-07-25 16:55:30 +02:00
Colin Campbell
cd44ef2dc9 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: Paul Poulain <paul.poulain@biblibre.com>
2012-07-25 15:52:24 +02:00
Colin Campbell
3b694b9b1c Bug 8486 Correct calculation of days_between
Thee 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
2012-07-25 15:52:16 +02:00
Paul Poulain
39701b8666 Merge remote-tracking branch 'origin/new/bug_5644' 2012-07-16 12:43:09 +02:00
2598964b10 Bug 5644 : Fixing the test
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-16 12:42:51 +02:00
Jared Camins-Esakov
407583aa93 Bug 8353 follow-up: Perltidy new test
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-07-13 14:42:52 +02:00
Henri-Damien LAURENT
8bf1c18e96 Bug 8353: Adds a test to check for missing sysprefs in the database
Adds a non-test mode (--showsql option) that displays the missing
sysprefs as sql inserts.  Some sysprefs were missed from the syspref
file due to extra spaces in the insert : fixed. The test now checks if
there are at least as many sysprefs in the database as in the syspref
file (instead of checking for the exact number)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Cherrypicked from BibLibre master, rebased onto current master, and
corrected typos, 2012-07-03

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-07-13 14:42:40 +02:00
Jared Camins-Esakov
7ddf7cbb03 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>
2012-07-10 11:13:40 +02:00
Jonathan Druart
623f3a2c84 Bug 8233 : SearchEngine: Add a Koha::SearchEngine module
First draft introducing solr into Koha :-)

List of files :
  $ tree t/searchengine/
  t/searchengine
  |-- 000_conn
  |   `-- conn.t
  |-- 001_search
  |   `-- search_base.t
  |-- 002_index
  |   `-- index_base.t
  |-- 003_query
  |   `-- buildquery.t
  |-- 004_config
  |   `-- load_config.t
  `-- indexes.yaml
  just do `prove -r t/searchengine/**/*.t`

  t/lib
  |-- Mocks
  |   `-- Context.pm
  `-- Mocks.pm
  provide a mock to SearchEngine syspref (set_zebra and set_solr).

  $ tree Koha/SearchEngine
  Koha/SearchEngine
  |-- Config.pm
  |-- ConfigRole.pm
  |-- FacetsBuilder.pm
  |-- FacetsBuilderRole.pm
  |-- Index.pm
  |-- IndexRole.pm
  |-- QueryBuilder.pm
  |-- QueryBuilderRole.pm
  |-- Search.pm
  |-- SearchRole.pm
  |-- Solr
  |   |-- Config.pm
  |   |-- FacetsBuilder.pm
  |   |-- Index.pm
  |   |-- QueryBuilder.pm
  |   `-- Search.pm
  |-- Solr.pm
  |-- Zebra
  |   |-- QueryBuilder.pm
  |   `-- Search.pm
  `-- Zebra.pm

How to install and configure Solr ?
  See the wiki page: http://wiki.koha-community.org/wiki/SearchEngine_Layer_RFC

http://bugs.koha-community.org/show_bug.cgi?id=8233
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-07-06 16:51:58 +02:00
5bad52eef2 added date and ISBN tests to Koha.t
modified:   Koha.t

$ prove  -v ./Koha.t

1..5
ok 1 - use C4::Koha;
ok 2 - use C4::Members;
    1..6
    ok 1 - Insert data in database
    ok 2 - GetAuthorisedValueByCode
    ok 3 - GetKohaImageurlFromAuthorisedValues
    ok 4 - lost and paid works
    ok 5 - Child area works
    ok 6 - Withdrawn works
ok 3 - Authorized Values Tests
    1..4
    ok 1 - C4::Koha->can('GetDailyQuote')
    ok 2 - Got a quote based on id.
    ok 3 - Got a random quote.
    ok 4 - Got a quote based on today's date.
ok 4 - Daily Quotes Test
    1..7
    ok 1 - slashifyDate
    ok 2 - xml_escape() returns empty string on undef input
    ok 3 - xml_escape() works as expected
    ok 4 - ... and does not change input in place
    ok 5 - _isbn_cleanup removes hyphens
    ok 6 - _isbn_cleanup removes parenthetical
    ok 7 - _isbn_cleanup converts ISBN-13 to ISBN-10
ok 5 - Date and ISBN tests
ok
All tests successful.
Files=1, Tests=5,  1 wallclock secs ( 0.02 usr  0.01 sys +  0.48 cusr  0.06 csys =  0.57 CPU)
Result: PASS

http://bugs.koha-community.org/show_bug.cgi?id=5327
2012-07-06 11:35:40 +02:00
Stacey Walker
3fffe40cd1 bug 5327: added some tests for C4/Items.pm
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-07-06 11:33:42 +02:00
Julian Maurice
203757e353 Bug 7304: More permissions for budgets
- Possibility to add users to a budget
- Restrictions changed to:
  - None
  - Owner
  - Owner and users
  - Owner, users and library
- Restricted users cannot spent on these budgets (they cannot modify them
  either)

Modified pages:
 - admin/aqbudgets.pl
 - admin/aqplan.pl
 - suggestion/suggestion.pl
 - acqui/acqui-home.pl
 - acqui/addorderiso2709.pl
 - acqui/basket.pl
 - acqui/neworderempty.pl

Unit tests in t/Budgets/CanUserUseBudget.t and t/Budgets/CanUserModifyBudget.t

Bug 7304 tmp

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-27 16:25:44 +02:00
Colin Campbell
9929c52a57 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>
2012-06-20 11:14:00 +02:00
Paul Poulain
84ec97123b Merge remote-tracking branch 'origin/new/bug_7952' 2012-06-14 15:56:29 +02:00
Dobrica Pavlinusic
1e5f68fdcb 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.
2012-06-14 15:54:06 +02:00
c58f8f84d9 Bug 5337 : Upping the count of the unit tests 2012-06-14 15:43:08 +02:00
Matthias Meusburger
7f957077dd Bug 5337: EAN management : Adds ean for various searches
- in various acquisition pages and serials home
  - in database : biblioitems.ean
  - adds ean and its mapping in default english bibliographic framework
  - adds ean mapping in default french bibliographic framework
  - ean search is not enabled for MARC21

The required mapping between the ean marc field and the biblioitems.ean
database field will be automatically added on an existing unimarc installation.

However, if you already have records with ean, you will have to
run misc/batchRebuildBiblioTables.pl to populate biblioitems.ean

Signed-off-by: jmbroust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Passed QA at second run. Removed a merge marker only.
2012-06-09 18:26:34 +02:00
Jared Camins-Esakov
d5d6daad1c Bug 8092: Convert Koha::Cache to use CHI
Implements cache handlers for Memcached, mmap shared-file persistent,
and in-process memory caches. If CHI is unavailable, Koha::Cache::Memcached
will fall back to using Cache::Memcached::Fast, or caching will be skipped
without croaking.

To test: run t/Cache.t with the following options, before and after
installing CHI:

2. Tests 3-9 should be skipped with the following:
export CACHING_SYSTEM=

2. You should receive two failures with the following if CHI is not installed:
export CACHING_SYSTEM=memory

3. You should receive two failures with the following if CHI is not installed:
export CACHING_SYSTEM=fastmmap

4. You will need memcached activated for the following to work (but it
   will work both with and without CHI):
export CACHING_SYSTEM=memcached
export MEMCACHED_SERVERS=127.0.0.1:11211
export MEMCACHED_NAMESPACE=KOHA

5. You should receive two failures with the following:
export CACHING_SYSTEM=thisdoesntexist

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

Works as advertised, now we need a follow up to add the new dependency.

http://bugs.koha-community.org/show_bug.cgi?id=8029
2012-06-09 13:08:13 +02:00
Chris Cormack
688d62f9d7 Bug 5327 : Fix for XISBN test, thingisbn is now handing back different results 2012-06-05 16:24:53 +02:00
Srdjan
722ca127dd 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
2012-05-28 13:52:39 +02:00
Chris Nighswonger
ef064dca6d Bug 7977: Adding Daily Quotes Tests to Koha.t test suite; also fixing sort order on quote selection SQL
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
2012-05-24 14:14:45 +02:00
Chris Hall
03fee7a590 Bug 7248 Added caching support and and moved Caching into Koha namespace
Unit test for Koha/Cache.pm (which includes Koha/Cache/Memcached.pm)

Note that in order to test Koha::Cache you must export the environment variable
MEMCACHED_SERVERS. For example:
$ export MEMCACHED_SERVERS=127.0.0.1:11211

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-05-15 18:05:55 +02: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
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
Chris Cormack
ec23131ea1 Bug 5549 : Fixing the test to only run if the test data exists
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
test passes after the patch. Win.
2012-03-27 09:18:37 +02:00