Commit graph

1349 commits

Author SHA1 Message Date
Jonathan Druart
7135bae0bb Bug 13853: Add tests for is_waiting
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-11 14:48:44 -03:00
f081063d72 Bug 13030: Show waiting hold expiration date for waiting holds on circulation.pl
We should show the date a waiting hold is set to expire for each hold in
the list of waiting holds in circulation.pl

Test Plan:
1) Apply this patch
2) Find a waiting hold for a patron, browser to circulation.pl
   for that patron
3) Set system preference ReservesMaxPickUpDelay to 5
4) Refresh circulation.pl, note the waiting holds now display a
   "waiting until" part with the waiting date plus 5 days
5) Set system preference ReservesMaxPickUpDelay to 0 ( or empty
   string )
6) Refresh circulation.pl, note the waiting hols no longer have a
   "waiting until" line.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Followed test plan successfully. Automated tests successful.

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

Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us>

Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org>

Bug 13030 [QA Followup] - Fix unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-11 14:47:22 -03:00
7f797b3244 Bug 6874: [QA Follow-up] Last adjustments for future developments
This patch does:

[1] Some trivial template changes. Modified some comments (POD lines).
[2] Converted plugin to new style.
[3] Table updates: renames id to hashvalue, adds a autoincrement id,
    adds filesize, timestamp, owner and category.
    RM: This db rev is in a separate sql file in atomicupdate.
[4] Code references to computed hash renamed to hashvalue instead of id.
[5] Removed some code pertaining to exposing upload dir structure. The user
    now may choose a category; the uploader takes care of storage.
    The list of upload categories is now taken from authorised values; this
    might become a separate table in the future. (If there are none,
    the upload process creates one default fallback.)
    We can add e.g. permissions later, subdir structure, etc. (So dir will
    not necessarily be category anymore.)

Test plan:
[1] Run the db revision.
[2] Upload new file. Check the record in the table. Delete it again; check.
[3] Run t/db../UploadedFiles.t.
[4] Run t/db../FrameworkPlugins.t -incl cataloguing/value_builder/upload.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:23:36 -03:00
d7cdb6e15e Bug 6874: [QA Follow-up] Adjustments for opac-retrieve
Adds httpheaders sub to UploadedFiles; this will be extended on a new
report. (Idea is to add configurable headers for file extensions.)
Trivial unit test added.
Small cosmetic changes to opac-retrieve-file.

Test plan:
Run test UploadedFiles.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:23:36 -03:00
Mark Tompsett
b113318bb2 Bug 6874: Catch warnings for clean tests.
I hate noisy tests, so I cleaned them up.

MEGA TEST PLAN
--------------
git checkout -b bug_6874 origin/master
git bz apply 6874
-- yes, it should all apply smoothly.
I intentionally restored an old backup from a couple months ago to force the upgrade.
staff client:
-- upgrade
-- login
Koha administration
MARC Bibliographic framework
MARC structure (for BKS)
Search for 856
Subfields
Edit (for u)
Other options
Plugin: upload.pl
Save changes
Search the catalog tab
{choose a word, any word. I used fancy, because I knew we had a cookbook}
click first link
Edit
Edit record
8 (that's the tab name)
click the name for 856
scroll down to u and click the plugin icon
-- Correctly got a configuration error message.

At a command prompt:
vi ~/koha-dev/etc/koha-conf.xml
/enable_plug
-- add in:
<upload_path>{appropriate path. I used /home/mtompset/uploads}</upload_path>
:wq
mkdir {appropriate path used}
-- I even added some subdirectories
sudo chown -R -v www-data.www-data {appropriate path used}

Back in staff client:
click the plugin icon again
-- this time an upload screen pops up
click the 'Upload file' button
-- message about no file or destination
browse for a file, select one
click the 'Upload file' button
-- message about no destination
click the 'Cancel' button
click the plugin icon
click a destination radio button
click the 'Upload file' button
-- message about no file
browse for a file, select one
click the 'Upload file' button
-- message about success
click the 'close' button.
-- the text box has been filled in with a nice URL
click the plugin icon
click cancel
click the plugin icon
click delete
-- the test box should be blanked, and a success message given
click Close
-- reupload a file properly
click the plugin icon
click delete
click upload file
browse for a file, select a destination, click upload file
click close on success message
click 'Clone this subfield'
click the second plugin icon
click delete
click close
click the first plugin icon
-- Nice error message about a URL which points to nothing.
click cancel
In the second 856$u type in a URL (eg. www.google.com)
click the second plugin icon
-- this jumps immediately to the upload screen, but does not give an error message, because the URL does not have opac-retrieve-file in it.
click save (we need to save the bibliographic record)

In OPAC:
search for the same word (I used fancy)
find the entry you just updated with links
click the two links. The dangling entry should give you a 500 error, and the other link should work just fine.
get back to the detail page

In staff client:
edit
edit record
8
change the 856$u to a valid file in the first link.
save

In OPAC:
refresh the detail page, and click the first link again
this time it should get downloaded nicely.

From a command line:
prove -v t/db_dependent/UploadedFiles.t
perldoc C4::Biblio
perldoc C4::UploadedFiles

One more round of tests tomorrow, and this should be ready. :)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Tested on top of 5010

Followed mostly mega test plan, seems to work :)
Can upload, delete, modify, etc
Test runs Ok
No koha-qa errors

I view this as valuable addition, dangling since 2011!
As with 5010, I consider this can be pushed (for 3.22)
and we can fix anything wrong later.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:23:36 -03:00
Mark Tompsett
64079ccaa3 Bug 6874: kohastructure.sql, jquery.js, refocus, and more
Two problems were discovered while doing a fresh install
of Koha. These problems in the kohastructure.sql file are
addressed with this patch.

Clicking the plug-in icon should cause the popup window
to refocus.  This adds the refocus code to the upload.pl file.

The path to the jquery.js script was wrong in the
upload_delete_file.tt file. Changed [% themelang %] to
[% interface %].

If a user clones 856$u after uploading a file, deletes the file,
and then clicks the plugin icon on the first 856$u, this will go
immediately to the upload screen with an informative error
message.

After some validation was added, it was extended to include
other cases. This serves to patch 6874 to a state where sign
off should be possible.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:45 -03:00
094092b111 Bug 6874: (QA followup) Attach files to bibliographic records
* Renames uploadPath to upload_path to follow the standard naming
  conventions in koha-conf which use underscores rather than camel case
* Remove reference to intranet-tmpl and replace with [% interface %]
  required to pass qa

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:13 -03:00
Julian Maurice
9f0546f003 Bug 6874: Move uploadPath syspref to koha-conf.xml
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:06 -03:00
Julian Maurice
209faec183 Bug 6874: Add unit tests for C4::UploadedFiles
Add unit tests for C4::UploadedFiles and move a variable
declaration at subroutine level instead of file level.
Add dependency to Test::CGI::Multipart

Still works, and the newly-provided unit tests have good test
coverage:
C4/UploadedFiles.pm 90.7    65.0    66.7    100.0   100.0    0.2    86.4

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:06 -03:00
a9ec41e962 Bug 13851: (QA followup) Unit Tests
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-07-29 15:47:28 -03:00
062f34c55d Bug 13851: Replace waiting holds logic in circulation.pl with Koha Objects
This is the original patch for bug 12892 and replaces the older style of
fetching the holds data with Koha Objects. It will be used as a
foundation for future features.

Test Plan:
1) Apply this patch
2) Create a hold, set to waiting
3) Browse to circulation.pl for that patron
4) Note you see the list of waiting holds
5) Switch your logged in branch to a different branch
6) Note the "Waiting at" line is no longer emphasized.

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

Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us>

Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-07-29 15:47:13 -03:00
5c3c679728 Bug 13049: Merge selfreg cron jobs into cleanup_database
This patch moves the core code of two selfreg cron jobs into the Members
module. The new routines are called from cleanup_database with two new
parameters. The old cron jobs are now wrappers to cleanup_database.
As a bonus, we can add a unit test now.

In time, we can obsolete the selfreg cron jobs. For now, the code is in one
place and behavior does not change.
A next step (as described on the Bugzilla report) would be: remove the Delay
pref for self regs.

Test plan:
Run the unit test t/db_dependent/Members.t.
Test the two new parameters of cleanup_database.pl.
Verify if delete_expired_opac_registrations.pl still works.
Same for delete_unverified_opac_registrations.pl.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
. Fixed minor merge confict on UT & cleanup_database.pl
. UT ok
. The two deprecated scripts still work as before, with a warning
  message.
. cleanup_database.pl do the deletion job, calling new C4::Members
  function rather that doing it directly.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-28 10:24:02 -03:00
Stéphane Delaune
62dc6b0ca1 Bug 10961: (followup) Make query fields explicit and add regression tests
add correct frameworkcode to _koha_marc_update_bib_ids parameters

add test, prove with : prove t/db_dependent/Biblio.t

TEST PLAN
---------
1) git checkout -b bug_10961 origin/master
2) git bz apply 10961
3) git checkout origin/master -- C4/Biblio.pm
4) prove t/db_dependent/Biblio.t
   -- was expecting failure, got failure.
5) git reset --hard origin/master
6) git bz apply 10961
7) prove t/db_dependent/Biblio.t
   -- success as expected.
8) Read over code.
   -- Noted it also grabs the framework code for the biblio, rather than uses default.
      And it also corrects an indentation issue.
      Test case looks like it attempts to cover the biblionumber!=biblioitemnumber case
      by adding 1.
9) run koha qa test tools.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-28 10:19:51 -03:00
Jonathan Druart
2eded5f165 Bug 8684: Add regression tests for SearchItemsByField
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-07-24 13:40:43 -03:00
5e14748360 Bug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings
This patch introduces a regression test for the situation in which
an itemnumber on a record matches the authid of an authority record
and the current implementation of the EmbedSeeFromHeadings filter
wrongly includes new holding fields with authority data...

To test:
- Apply the patch
- Run:
  $ prove t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t
=> FAIL: The test 'Holdings fields not processed to introduce See-from heading'
   fails.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-07-24 13:39:53 -03:00
Tomas Cohen Arazi
b69beb2499 Bug 14167: (QA followup) use warn instead of just STDERR
This patch makes Koha::Logger use 'warn' instead of just printing
to STDERR. It introduces tests for this warnings too.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-21 10:50:17 -03:00
c339b5e4cc Bug 14167: Add a unit test for Koha::Logger
Test plan:
Run the test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-21 10:19:03 -03:00
Mark Tompsett
588f13e699 Bug 14121: Silence warnings t/db_dependent/Auth_with_cas.t
TEST PLAN
---------
1) $ prove t/db_dependent/Auth_with_cas.t
   -- CGI security warning
2) apply patch
3) $ prove t/db_dependent/Auth_with_cas.t
   -- no noise.
4) koha qa test tools

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Not able to reproduce the error on my setup, but the code
is a clear improvement over the previous version.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:32:21 -03:00
1a8962f306 Bug 14494: Add some unit tests too for CalcDateDue
The second patch of this report made some changes to CalcDateDue.
We are adding some unit tests here.
See the commments on the third patch too.

Test plan:
Run t/db_dependent/Circulation_dateexpiry.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Set the number of tests for the second subtest (was
commented) and perltidy the second block.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:16:24 -03:00
Jonathan Druart
e0986f5a79 Bug 14494: Unit tests for CanBookBeIssued related to dateexpiry
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Moved the test on its own. Nicer than adding TestBuilder in the final part
of the test. No warnings/errors from TestBuilder, no dependency..

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:16:24 -03:00
Mark Tompsett
63427fce60 Bug 14428: Remove C4::Input
Jonathan Druart agreed that C4::Input is vestigial code that should be removed.
Here is how I checked. First I found where C4::Input was used. Then, I checked
what functions are in the package: just checkdigit. Then, I confirmed that
checkdigit is not used at all in any acquisition, administration, or member
related perl scripts. Lastly, I took a look at our supposed test file for the
package. It was painfully sparse.

As such, this patch removes the test file and the package file, and removes
C4::Input references from these six files:
- acqui/addorderiso2709.pl
- acqui/basketgroup.pl
- acqui/neworderempty.pl
- acqui/uncertainprice.pl
- admin/aqplan.pl
- members/memberentry.pl
NOTE: neworderempty had 3 lines of it?! Didn't anyone see that?!

Here is the output of what I did to confirm this correction:

mtompset@debian:~/kohaclone$ git reset --hard origin/master
HEAD is now at 6e9086f Bug 3206: (QA followup) missing comma on sysprefs.sql
mtompset@debian:~/kohaclone$ git grep C4::Input
C4/Input.pm:package C4::Input; #assumes C4/Input
C4/Input.pm:C4::Input - Miscellaneous sanity checks
C4/Input.pm:  use C4::Input;
acqui/addorderiso2709.pl:use C4::Input;
acqui/basketgroup.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/uncertainprice.pl:use C4::Input;
admin/aqplan.pl:use C4::Input;
members/memberentry.pl:use C4::Input;
t/Input.t:        use_ok('C4::Input');
mtompset@debian:~/kohaclone$ grep sub C4/Input.pm
sub checkdigit ($;$) {
                my $temp2 = substr($infl,$i,1);
        if ($rem eq substr($infl,8,1)) {
} # sub checkdigit
mtompset@debian:~/kohaclone$ grep checkdigit `find acqui -type f`
mtompset@debian:~/kohaclone$ grep checkdigit `find admin -type f`
mtompset@debian:~/kohaclone$ grep checkdigit `find members -type f`
mtompset@debian:~/kohaclone$ cat t/Input.t

use strict;
use warnings;

use Test::More tests => 1;

BEGIN {
        use_ok('C4::Input');
}

Apply this patch, and the output of git grep C4::Input will be empty.
Run koha qa test tools (kind of overkill)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-10 10:53:56 -03:00
Jonathan Druart
94315f663b Bug 9942: Make Koha fails if privacy is not respected
If a patron has requested anonymity on returning items and the system is
not correctly configured (AnonymousPatron no set or set to an inexistent
patron), the application should take it into account and not fail
quietly.

This patch is quite radical: the script will die loudly if the privacy
is not respected.

To be care of the bad "Software error", some checks are done in the
updatedatabase to be sure the admin will be warned is something is wrong
in the configuration.

Test plan:
1/ Test the updatedatabase entry:
a. Turn on OPACPrivacy and set AnonymousPatron to an existing patron
=> You will get a warning
b. Turn on OPACPrivacy and set AnonymousPatron to 0 or ''
=> You will get a warning
c. Turn on OPACPrivacy and set the privacy to 2 (Never) for at least 1 patron
Turn off OPACPrivacy
=> You will get a warning
d. In all other cases you will get no error

2/ Test the interface
a. Turn on OPACPrivacy and set the privacy to 2 (Never) for a patron
b. Now you can turn off OPACPrivacy or keep it on, behavior should be
the same
c. check an item out the patron
d. Check the item in using the check out table
=> fail
e. Check the item in using the Check in tab
=> fail (not gracefully).

Note that the software error could appear on other pages too.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Updatedatabase works as described
On staff, if don't have correct settings for anonymity it's
impossible to check-in (with OPACPrivacy on)
No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-07 14:52:32 -03:00
186b635a75 Bug 13014: (QA followup) have new warnings tested
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-24 14:54:36 -03:00
Jonathan Druart
734a6805c8 Bug 13014: Notify budget owner on new suggestion - UT
When a suggestion is created and linked to a fund, a mail will be
generated, using a cronjob, to notify the budget owner.

A suggestion is considered as "can be treated" if its status is "ASKED".

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-24 11:39:40 -03:00
Jonathan Druart
cbf3c9aa40 Bug 14439: Add test - template path should finish by .tt
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-24 10:53:25 -03:00
Jonathan Druart
64e47c63dc Bug 14408: Allow integers in template paths
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:44:58 -03:00
Jonathan Druart
5dd7c8f0d5 Bug 14408: Add tests to get_template_and_user
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:44:58 -03:00
Stefan Weil
0cac7bc140 Bug 14383: Fix some typos in comments and documentation
Most of them were found and fixed using codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

http://bugs.koha-community.org/show_bug.cgi?id=14383
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:34:46 -03:00
Jonathan Druart
a712f5b7ba Bug 13993: Clarify test messages
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-06-19 11:45:23 -03:00
Mark Tompsett
b335b72991 Bug 13993: (1) Add tests to confirm 'new' and 'cancelled'
This adds 2 tests to t/db_dependent/Acquisition/TransferOrder.t
in order to confirm the order's status is properly marked.

TEST PLAN
---------
1) Log into staff client
2) Acquisitions
3) Create a basket for two differing vendors.
4) Place an order in one of the baskets.
5) Transfer the order from one vendor's basket to the others.
6) Apply this patch (1) only
7) prove -v t/db_dependent/Acquisition/TransferOrder.t
   -- should fail one test: not marked as 'cancelled'.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-06-19 11:44:45 -03:00
Benjamin Rokseth
57608fdecb Bug 7981: Remove HomeOrHoldingBranchReturn syspref
This patch removes HomeOrHoldingBranchReturn syspref and makes circ/returns.pl respect branch
circulation rules from C4::Circulation::GetBranchItemRule. Also transfer slip notice should reflect this.

Default should always be to return item to home branch.

Test plan:
- make sure syspref 'AutomaticItemReturn' is set to 'false'
- unset 'Default checkout, hold and return policy' or set 'Return policy' to 'Item returns home'
- checkout an item and do a checkin from different branch than items homebranch
- verify that you're prompted with a transfer message to item's home branch and that print slip matches

- set 'Return policy' to 'Item returns to issuing library'
- do a checkout and a checkin from branch different than item's home branch
- verify that you're not prompted with a transfer message and that holding library is your current branch

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

Follow-up:
- Added 3 tests in t/db_dependent/Circulation_Branches.t to test AddReturn
  policies
- Removed HomeOrHoldingBranchReturn from sysprefs.sql
- Added notice on removing syspref in updatedatabase

QA edits:
- removed trailing whitespace in tests
- moved branchname lookup from returns.pl to template

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

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-06-11 10:24:22 -03:00
Indranil Das Gupta
c07f83f643 Bug 14206: Adds test for getletter() call from overdue_notices.pl
Adds missing test for getletter() when called from overdue_notices.pl

Test plan
=========

1/ apply this patch
2/ run prove -v t/db_dependent/Letters.t
   all tests should pass, especially test #40 which tests call from
   overdue_notices.pl

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-11 10:14:35 -03:00
Indranil Das Gupta
8895caa339 Bug 14206: Adds delete function for non email templates
C4::Letters::getletter() is called in tools/letter.pl by the function
delete_confirm() to display the selected notice for deletion. Due to
current implementation of getletter(), a notice that does not use
the 'email' template (but uses any/all of the other templates - sms,
print or phone) can't be deleted from the staff client.

This patch adds deletion capability for notices that do not use email
template, but uses any/all of the other templates i.e. sms, print or
phone. This also adds 2 tests to t/db_dependent/Letters.t for testing
both conditions - a) when message_transport_type is specified b) when
it is not.

Test plan
=========

1/ Go to Tools -> Notices & Slips. Add a new notice only for print,
   leave 'Library' and 'Koha module' options as default selections.
   Enter 'KOHA_14206' and 'Koha Test 14206' against Code and Name
   respectively, and 'Test' and 'Test Message' for subject and body.
   Leave the Email, Phone and SMS tabs blank. Save the notice.
2/ On the notices listing page the new notice will be listed. Try to
   delete it. It will load the 'Delete notice' dialog form, but the
   table will not show any data under <th>s - 'Library', 'Module',
   'Code' or 'Name'.
3/ Click the "Yes, delete" button. The page will be submitted and the
   Notices listing reloaded. The print-only KOHA_14206 notice should
   continue to exist. This is *wrong*.
4/ Apply this patch
5/ Reload the listings page and click on the 'Delete' link for Notice
   KOHA_14206. This time, it should show the data under 'Module',
   'Code' or 'Name' at least.
6/ Click on 'Yes, delete'. The page should submit and the listing page
   reload. This time KOHA_14206 will be gone.
7/ Run prove -v t/db_dependent/Letters.t
   All tests should PASS without any error.

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-11 10:14:22 -03:00
efe5266625 Bug 13437: Preliminary changes for marc21 plugins field 008
Preliminary work on marc21_field_008.pl and 008_authorities.pl.
Moving $dateentered en $defaultval to lower scope level.
date_entered is a new sub (in a module); sub Field008 has been reduced to
one line.
Added a trivial unit test for date_entered.
Note: the format used in date_entered could be added in DateUtils, moving
this logic to a better place.

Test plan:
Use both plugins in the marc21 editor (biblios/authorities).
Run the adjusted unit test.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Both plugins works, no errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-10 12:51:26 -03:00
Jonathan Druart
c5bc51d7d1 Bug 14256: (follow-up) Check for unique constraint to regenerate random data
There were some issues in the previous patch. This patch fixes the
following:
- rename $value with $original_value
- remove $at_least_one_constraint_failed and $values_ok which make the
  code unnecessarily complicated
- the constraints have to be checked only if no original value is passed
- _buildColumnValue created a key to the default value hashref, it broke
  the test:
    last BUILD_VALUE if exists( $default_value->{$source} );

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-10 12:47:07 -03:00
395304d3b5 Bug 14256: Check for unique constraint to regenerate random data
Unique constraints should be checked when creating random data. Otherwise
we get failures when the generated data already exists on the DB.

This patch takes advantage of ->unique_constraints() to do the job,
looping through all the unique constraints defined for the source.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-10 12:47:06 -03:00
717fa8440d Bug 14334: t/db_dependent/Letters.t AutoCommit fix
TEST PLAN
----------
1) git reset --hard origin/master
2) prove t/db_dependent/Letters.t
   -- horrible failure about transaction
3) apply this patch
4) prove t/db_dependent/Letters.t
   -- no issues
5) koha qa test tools.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-07 18:51:22 -03:00
Mark Tompsett
af6bb0b4db Bug 14334: t/db_dependent/Budgets.t AutoCommit fix
TEST PLAN
----------
1) git reset --hard origin/master
2) prove t/db_dependent/Budgets.t
   -- horrible failure about transaction
3) apply this patch
4) prove t/db_dependent/Budgets.t
   -- no issues
5) koha qa test tools.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-07 18:51:22 -03:00
Mark Tompsett
7f4a7f2eb3 Bug 14334: t/db_dependent/Bookseller.t AutoCommit fix
TEST PLAN
----------
1) git reset --hard origin/master
2) prove t/db_dependent/Bookseller.t
   -- horrible failure about transaction
3) apply this patch
4) prove t/db_dependent/Bookseller.t
   -- no issues
5) koha qa test tools.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-07 18:51:21 -03:00
5f5903737e Bug 14342: Unit tests in t/db_dependent/Context.t failing due to Bug 13967
The introduction of system preference objects in bug 13967 has caused
the current testing regimen to fail do to the mixing of DBI mocking and
DBIx::Class.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Context.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-07 18:38:45 -03:00
46419b797b Bug 14346: t/Biblio.t fails because of new warning
Running

 $ prove t/Biblio.t

fails because of us now using DBIx to retrieve sysprefs. Then our mocked DBI is not "supported" by DBIx hence a warning that makes our test fail (there is one more warning now).

The cool thing about this, is that it actually helped spot a situation where GetMarcBiblio is doing wrong things because is not checking its parameters are undefined, so we have the chance to fix it.

This patch makes GetMarcBiblio return undef if no biblionumber is passed, and
also raises a conveniently carped warning. This change is tested in t/Biblio.t with new tests.

To test:
- In current master, run
  $ prove t/Biblio.t
=> FAIL: a test detects a wrong warning count and fails.
- Apply the patch and run
  $ prove t/Biblio.t
=> SUCCESS: Tests now pass, and there are 2 new ones.
- Sign off :-D

Regards

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-07 18:37:32 -03:00
2e11350fe3 Bug 13967: (QA followup) Make DBIx control transactions on tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-04 15:12:45 -03:00
Jonathan Druart
2fa99fc7a0 Bug 13967: Add a couple of tests for SysPref and Object
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
2015-06-04 10:39:16 -03:00
6882949b1b Bug 13967 - System preferences need a package
System preferences should have a package based on Koha::Object to remove
the need for direct manipulation via SQL.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/sysprefs.t

Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-04 10:39:11 -03:00
Mark Tompsett
8e726e3ee1 Bug 14111 - More t/Auth_with_shibboleth.t silencing
TEST PLAN
---------
1) Apply first patch
2) prove t/Auth_with_shibboleth.t
   -- failed?!
3) apply this patch
4) prove t/Auth_with_shibboleth.t
   -- success. *whew*
5) koha-qa test tools.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Test remarks: Expected outcome as per test plan. No anomaly noted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-04 10:12:03 -03:00
Mark Tompsett
85a057bc5e Bug 14111: Silence warnings in t/Auth_with_shibboleth.t
Poorly capturing warnings_exist test cases generated noise.
This patch fixes that.

TEST PLAN
---------
1) $ prove t/Auth_with_shibboleth.t
   -- There are messages about lines 132 and 133. Noise.
2) Apply patch
3) $ prove t/Auth_with_shibboleth.t
   -- No messages. YAY!
4) koha qa test tools

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Test remarks: Expected outcome as per test plan. No anomaly noted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-04 10:12:03 -03:00
Mark Tompsett
1651cf70d1 Bug 5010: Fix OPACBaseURL to include protocol
First, it is strongly recommended to set the OPACBaseURL. But
this patch allows the inclusion of the protocol and not just
a site.

Next, C4/Auth now puts OPACBaseURL into the template parameters
regardless of OPAC or Staff clients.  t/db_dependent/Auth.t was
tweaked to add a check for confirming that get_template_and_user
adds OPACBaseURL to both OPAC and Staff templates.

In the staff client, once the OPACBaseURL is set, you get a nice
OPAC View link when viewing a biblio's detail. It should reflect
the protocol used now.

Hard coded 'http://' strings were removed from the
sample_notices.sql files. This is what required also updating
the letters table in the updatedatabase.pl script.

The explanation text in the sysprefs.sql needed updating too to
reflect the inclusion of the protocol. And this was the other
update done in the updatedatabase.pl script. The opac.pref file
was similarly changed as well.

catalogue/detail.pl had no need to pass a custom OpacUrl value,
since C4/Auth passes the required OPACBaseURL, so it and the
corresponding template were modified.

Both the MARC21 and NORMARC intranet details files had 'http://'
hard coded in them. This was removed.

Both the bootstrap and prog theme opac-detail template had a
protocol parameter that was used. The logic for the parameter
was not removed, because it is used extensively in one template.
Perhaps it should be used to simplify the other. However, the
calculated current_url parameter had references to the protocol
removed, because of the changes to OPACBaseURL.

opac/opac-shareshelf.pl had a hard coded 'http://' which was
removed.

t/db_dependent/Auth_with_cas.t had 'http://' added to the value
set for OPACBaseURL.

In virtualshelves/sendshelf.pl explicit code which sent the
OPACBaseURL preference was removed, since C4/Auth sends it all
the time now.

C4::Context::set_preference was tweaked to ensure that
OPACBaseURL would always start with http.
t/db_dependent/Context.t was tweaked to specifically test this.

The Shibboleth authentication needs OPACBaseURL set, and that
it be https protocol. The _get_uri routine was tweaked to always
pass back https:// as the protocol on the OPACBaseURL.
t/Auth_with_shibboleth.t was tweaked to specifically test the
changes.

TEST PLAN
---------
This is not an easy patch to test. Difficulties include:
- configuring Koha to run under https
    (tweaking apache2 isn't so hard, just tricky)
- configuring Koha to run OPAC and Staff with Plak
    (since code with comments about plak were sliced out)
- configuring Koha to use CAS
    (may be requires for the CAS test)

 1) Apply patch
 2) Make sure OPACBaseURL is set without the protocol included.

UPDATEDATABASE
 3) back up your DB
 4) ./installer/data/mysql/updatedatabase.pl
    -- It should run without errors.
 5) Look up the OPACBaseURL system preference in the staff
    client
    -- It should have http:// prepended.
 6) Run the mysqlclient from your koha git directory
      USE koha_library;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
    -- There should be no prepended http:// on the
       <<OPACBaseURL>>.
 7) restore your DB
 8) Make sure OPACBaseURL is set with the protocol included,
    preferably https.
    -- Using https requires a bunch of apache2 tweaks.

AUTH
 9) Call up staff client.
10) Call up OPAC.
    -- C4/Auth.pm doesn't barf.
11) Call up Plack staff client
12) Call up Plack OPAC.
    -- C4/Auth.pm doesn't barf.
13) prove -v t/db_dependent/Auth.t

CONTEXT
14) Home -> Koha administration -> Global System Preferences
         -> OPAC
15) Modify and save OPACBaseURL to not have http:// or https://
    on it.
    -- It should be modified to include http://
16) Modify and save another system preference.
    -- It should save normally
17) prove -v t/db_dependent/Context.t

CATALOGUE/DETAIL (tt & pl)
18) Confirm the OPACBaseURL is set
19) Navigate to any biblio details in the staff client
    -- There should be a "OPAC view" link which has the
       correct http:// or https:// in it.

SQL (sample notices and sysprefs)
20) Run the mysqlclient from your koha git directory
      USE koha_library;
      DELETE FROM letter;
      source installer/data/mysql/de-DE/mandatory/sample_notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
      DELETE FROM letter;
      source installer/data/mysql/en/mandatory/sample_notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
      DELETE FROM letter;
      source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
      DELETE FROM letter;
      source installer/data/mysql/es-ES/mandatory/sample_notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
      DELETE FROM letter;
      source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
      DELETE FROM letter;
      source installer/data/mysql/it-IT/necessari/notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
      DELETE FROM letter;
      source installer/data/mysql/pl-PL/mandatory/sample_notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
      DELETE FROM letter;
      source installer/data/mysql/ru-RU/mandatory/sample_notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
      DELETE FROM letter;
      source installer/data/mysql/uk-UA/mandatory/sample_notices.sql;
      SELECT content FROM letter WHERE content LIKE "%<<OPACBaseURL>>%";
    -- Each of the selects should should lines that have
       <<OPACBaseURL>> starting them, but no hard-coded http://
      DELETE FROM systempreferences;
      source installer/data/mysql/sysprefs.sql;
      SELECT * FROM systempreferences WHERE variable='OPACBaseURL';
    -- The explanation should reflect the new explanation.
      QUIT
21) restore your DB
22) Make sure OPACBaseURL is set with the protocol included,
    preferably https.
    -- Using https requires a bunch of apache2 tweaks.

SLIM2INTRANETDETAIL
23) Set 'XSLTDetailsDisplay' system preference to default.
24) Set 'marcflavour' system preference to MARC21.
25) View any biblio's details.
    -- the URL beside 'OPAC View' should have the appropriate
       http:// or https://
26) Set 'marcflavour' system preference to NORMARC.
27) View any biblio's details.
    -- the URL beside 'OPAC View' should have the appropriate
       http:// or https://

OPAC-DETAIL
28) Set 'opacthemes' to bootstrap.
29) Set 'SocialNetworks' to enabled.
30) In OPAC, view any biblio's details.
    -- the Share links should have the appropriate protocol on
       the OPACBaseURL.
31) Set 'opacthemes' to prog.
32) In OPAC, view any biblio's details.
    -- the Share links should have the appropriate protocol on
       the OPACBaseURL.

AUTH_WITH_CAS
33) prove -v t/db_dependent/Auth_with_cas.t

OPAC-SHARESHELF
34) Set 'OpacAllowSharingPrivateLists' to allow.
35) In OPAC, 'Save to Lists' a search result.
36) Save it to a new private list.
37) Click the Lists button, and select the new list.
38) Click the Share button.

AUTH_WITH_SHIBBOLETH
39) prove -v t/Auth_with_shibboleth.t
    -- needs to be tests on Debian, because I can't get
       the Test::DBIx::Class installed in Ubuntu. :(

Rebased again on kohadevbox...

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

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-04 10:00:04 -03:00
Mark Tompsett
8f12796633 Bug 14325: Test calls C4::Context::set_userenv
This is a case of works by accident. This patch corrects the
set_userenv call.

TEST PLAN
---------
1) prove t/db_dependent/Borrower_Discharge.t
   -- works
2) git grep :set_userenv
   -- only this one file.
3) Confirm the the C4/Context.pm has a set_userenv
   which shifts the first parameter, as intended for
   a -> call and not a :: call.
4) apply patch
5) prove t/db_dependent/Borrower_Discharge.t
   -- still works
6) git grep :set_userenv
   -- nothing now.
7) run koha qa test tools

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-04 09:59:11 -03:00
Mark Tompsett
9c37d43102 Bug 14113: Silence t/Dates.t warnings and cleanup output.
The expectation of a user not freaking out over 'Illegal date'
messages is not sensible. Catch the messages, give a nicer
message.

Also, compress the veritical spacing on the output.

TEST PLAN
---------
1) $ prove t/Dates.t
   -- notice Illegal date messages, and extra lines between
      some sectional messages.
2) Apply patch
3) $ prove t/Dates.t
   -- Notice how nice and clean it is?
      Try it with -v to see all the output, including the
      expected warning type messages.
4) run koha qa test tools.

Test Remarks : complies with test plan.
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>a

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:13:54 -03:00
Mark Tompsett
9878663731 Bug 14116: Silence noisy output for t/Scrubber.
Why diag or print out things, unless it is -v?
And why print anything except success or failure type messages?
This cleans up the output.

TEST PLAN
---------
1) $ prove t/Scrubber.t
   -- there's some noise.
2) apply patch
3) $ prove t/Scrubber.t
   -- noise issue resolved.
      Output is still reasonable for -v.
4) koha qa test tools

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:10:56 -03:00
Mark Tompsett
a4b7df4490 Bug 14117: Silence warnings t/SearchPazPar2.t
The use of relative URLS (null actually), triggers warnings.
Catch them, instead of letting them loose.

TEST PLAN
---------
1) $ prove t/Search_PazPar2.t
   -- noise for each test currently.
2) apply patch
3) $ prove t/Search_PazPar2.t
   -- No noise, and extra tests added.
      -v shows caught warning tests.
4) koha qa test tools.

Signed-off-by: Indranil Das Gupta <indradg@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:10:14 -03:00
Mark Tompsett
4d4582566e Bug 14112: Silence warnings in t/Charset.t
After Jonathan said this was the wrong way to correct the issue,
www.utf8-chartable.de made it clear to me that the \c3\a9 were
missing x's.

TEST PLAN
---------
1) prove t/Charset.t
   -- noise
2) apply patch
3) prove t/Charset.t
   -- no noise
4) koha qa test tools

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-27 14:32:41 -03:00
Julian FIOL
9381c95dc3 Bug 14059: Deleting 'issues' table before processing the tests
It's suppose to avoid foreign key trouble

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No error

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-05-22 17:02:22 -03:00
Julian FIOL
9c80f1fd77 Bug 14059: Delete all export of get_column_names
This deals with my concerns raised in comment #2.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
2015-05-22 17:02:21 -03:00
Julian FIOL
5c7b3aa8d1 Bug 14059: Testing C4::Creators::Lib
Testing C4::Creators::Lib at 100%
Deleting get_column_names subroutine (never used)

    TEST PLAN
    ---------
    1. Apply patch
    2. prove -v t/db_dependent/Creators/Lib.t
    -- All 644 tests should run successfully without
    any error or warning

    TEST PLAN OPTIONAL
    ------------------

    Check with bug 13899 to see the coverage of this module.

    Coverage BEFORE this patch :
    Statement  :  11,6%
    Branch     :   0,0%
    Condition  :    N/A
    Subroutine :  36,0%

    Coverage AFTER this patch :
    Statement  : 100,0%
    Branch     : 100,0%
    Condition  :    N/A
    Subroutine : 100,0%

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
2015-05-22 17:02:21 -03:00
Mark Tompsett
5d8aa7b70b Bug 14114: Silence warns and cleanup t/Debug.t
TEST PLAN
---------
1) $ prove t/Debug.t
   -- What's with this BEFORE and AFTER stuff?!
2) apply patch
3) $ prove t/Debug.t
   -- cleaner, and you only get fuller output with -v.
4) koha qa test tools

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Cleaner, no koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-22 09:33:34 -03:00
Bernardo Gonzalez Kriegel
de448c0a1e Bug 14195: (followup) increment number of tests
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-20 11:05:27 -03:00
Jonathan Druart
ea41ef4ec9 Bug 14195: TestBuilder - A random string should not be longer than the DB field
t::lib::TestBuilder::_gen_text does not use correctly the regex and the
max parameter to generate the random string (String::Random).

This can cause future tests to fail.

http://bugs.koha-community.org/show_bug.cgi?id=14195
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Script tested, problem occurs, patch fixes it.
Bad number on commit subject
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-20 11:05:27 -03:00
fd581bea38 Bug 5338: (QA followup) update the tests for the new reports
This patch fixes the unit tests related to guided reports.
It is needed now that there are more options available.

It also fixes a wrong 'savedsql' key (should be 'sql') that
caused the tests to print warnings.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-19 13:54:09 -03:00
Julian Maurice
1970b245f5 Bug 13687: Move hold policy check into CanItemBeReserved
This way ILS-DI HoldItem and HoldTitle services also benefit from this
check

Test plan:

1/ Define some default holds policies by item type in
/admin/smart-rules.pl
2/ Use ILS-DI HoldItem service and check that those rules are respected
3/ Check that staff and opac hold behaviour is unchanged regarding
these rules.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script. No regressions found,
improves the ILS-DI HoldItem response.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-19 12:05:50 -03:00
Jonathan Druart
e546999f48 Bug 7380: Add tests for TT plugins
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-19 10:10:31 -03:00
422ffc6406 Bug 14200: Regression tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Karen Bryant <kbryant@ccpl-fl.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-19 09:45:04 -03:00
df8b81678b Bug 13673: (QA followup) Add license
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 16:00:28 -03:00
Mark Tompsett
49c384b242 Bug 13673: Silence noisy warnings in t/db_dependent/Barcodes.t
This last patch catches all the warning messages in tests.

TEST PLAN
---------
1) Apply first two patches
2) $ prove t/db_dependent/Barcodes.t
   -- still noisy warnings.
3) apply last patch
4) $ prove t/db_dependent/Barcodes.t
   -- All noisy warnings are caught.
5) koha qa test tools.

Signed-off-by: Indranil Das Gupta <indradg@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 16:00:28 -03:00
Mark Tompsett
aefcd68ff7 Bug 13673: Remove diags
TEST PLAN
---------
1) Apply first two patches
2) $ prove t/db_dependent/Barcodes.t
   -- Diags have been removed, just noisy warnings left.
3) $ git diff -w origin/master
   -- only excess print's and diag's removed.
4) koha qa test tools

Signed-off-by: Indranil Das Gupta <indradg@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 16:00:28 -03:00
Mark Tompsett
19e0fb4608 Bug 13673: Fix whitespace issues
Indentation was horrible. Fixed to meet 4 space standard.

TEST PLAN
---------
1) Notice tabs in t/db_dependent/Barcodes.t
2) $ prove t/db_dependent/Barcodes.t
3) apply patch
4) $ prove t/db_dependent/Barcodes.t
   -- same output as before.
5) $ git diff -w origin/master
   -- code is identical except for indentations.
6) koha qa test tools

Signed-off-by: Indranil Das Gupta <indradg@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 16:00:28 -03:00
Jonathan Druart
77930a5945 Bug 11385: Remove SQL::Helper
At this point, no occurrence of SQL::Helper should exist.
Let's remove the package and tests.

Test plan:
  git grep SQLHelper
and
  git grep InTable

Should not return anything in the Koha code.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 15:39:39 -03:00
Jonathan Druart
e196f19e2d Bug 12633: Remove SQLHelper in C4::Members
This is the only places where SQLHelper is still called.
The C4::Members::Search is not used anymore, but ModMember and
AddMember.

This patch replaced the calls to SQLHelper to use DBIX::Class.
TODO: Move them to Koha::Borrower.

Test plan:
1/ Make sure the patron search still works (no changes expected since the
code was not in used).
2/ Add a patron with all fields filled
3/ Add another patron with some fields filled
4/ Update them with other values
5/ Delete them

You should not get any errors.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 15:38:05 -03:00
a1b7f15062 Bug 14204: (QA followup) remove unneeded messages
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 15:34:22 -03:00
Nick Clemens
ad3b05996b Bug 14204: Fix t/db_dependent/Labels/t_Batch.t failing test from Bug 12991
This patch updaes the batch_id variable after items are added to test batch

To test:
1. prove t/db_dependent/Labels/t_Batch.t and see two tests fail
2. apply patch
3. prove again, tests pass!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

NOTE: The $batch->add_item() call to C4::Creators::Batch::add_item
      triggers the change of the batch_id so this line is necessary!
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 15:34:22 -03:00
Jonathan Druart
a072260bf6 Bug 13423: Fix number of tests in Serials.t
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:48:17 -03:00
Bernardo Gonzalez Kriegel
65b7ad030c Bug 13423: Remove unused serials-recieve
This patch removes two files, serials-recieve.pl and serial-recieve.tt
serials-recieve.pl is not called anyware
(it's recieve!)

Also removes the sub removeMissingIssue called only from serials-recieve.pl

git grep serials-recieve.pl .
C4/Serials.pm:called when a missing issue is found from the serials-recieve.pl file
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f" action="serials-recieve.pl" onsubmit="return barcode_check()">
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f2" action="serials-recieve.pl">
serials/serials-recieve.pl:serials-recieve.pl

Just a POD entry and self reference.

After removing of files

git grep removeMissingIssue .
C4/Serials.pm:      &check_routing &updateClaim &removeMissingIssue
C4/Serials.pm:=head2 removeMissingIssue
C4/Serials.pm:removeMissingIssue($subscriptionid)
C4/Serials.pm:sub removeMissingIssue {
t/db_dependent/Serials.t:is(C4::Serials::removeMissingIssue(), undef, 'test removing a missing issue');

Not used anymore

To test:
1) Apply the patch
2) Check serials workflow, no changes must be noted

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:48:17 -03:00
Jonathan Druart
a71a2cb9b6 Bug 11006: Drop column aqorders.totalamount
This column was not used in the Koha codebase, it can be removed.

Test plan:
Execute the updatedatabase.pl script and confirm that the column has
been dropped.

QA step:
1/ git grep totalamount
2/ prove t/db_dependent/Acquisition.t

Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:11:58 -03:00
Julian FIOL
64b6df43c9 Bug 14147: Add unit tests to C4::External::OverDrive
This patch test 'IsOverDriveEnabled' subroutine

    TEST PLAN
    ---------
    1. Apply patch
    2. prove -v t/External/OverDrive.t
    -- All tests should run successfully without
    any error or warning

    TEST PLAN OPTIONAL
    ------------------

    Check with bug 13899 to see the coverage of this module.

    Coverage BEFORE this patch :
    Statement  :  47,5%
    Branch     :   0,0%
    Condition  :   0,0%
    Subroutine :  75,0%

    Coverage AFTER this patch :
    Statement  :  49,1%
    Branch     :   0,0%
    Condition  :  33,3%
    Subroutine :  83,3%

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tests tun, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:11:58 -03:00
31f60fd522 Bug 13969: (QA followup) Delete issues before borrowers
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:11:46 -03:00
Julian FIOL
f863292a92 Bug 13969: Replace calls to $sth->fetchrow* with a call to $dbh->selectrow* and Cleaning files
1. Replace all calls to $sth->fetchrow_array
   with a call to $dbh->selectrow_array

2. Cleaning Review.t file with perltiny

3. Cleaning Review.t && Review.pl files with koha-qa tool

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:11:41 -03:00
Julian FIOL
6bc6d0254b Bug 13969: Testing C4::Review
Testing C4::Review in t/db_dependent/Review.t
Adding a pod for every sub

    TEST PLAN
    ---------
    1. Apply patch
    2. prove -v t/db_dependent/Review.t
    -- All 117 tests should run successfully without
    any error or warning

    TEST PLAN OPTIONAL
    ------------------

    Go check bug 13899 and see that coverage is 100% for this module.

    Coverage BEFORE this patch :
    Statement  :  21,9%
    Branch     :   0,0%
    Condition  :   0,0%
    Subroutine :  33,3%
    Pod        :  33,3%

    Coverage AFTER this patch :
    Statement  : 100,0%
    Branch     : 100,0%
    Condition  :    N/A
    Subroutine : 100,0%
    Pod        : 100,0%

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
All tests run

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:11:36 -03:00
Jonathan Druart
88537974e3 Bug 12743: ACQ: default values for catalogue records
At the moment, it is possible to create records in acquisitions, but the
ACQ framework is only used for items created in this module.

This patch allows to defined default values in the ACQ framework for
records created on the acquisition module.

Test plan:
1/ Make sure you have the ACQ framework created (otherwise create it
from the default framework).
2/ Define a default value for a field (for instance 099$z=1).
3/ Go in the acquisition module and create a new order from a new
record.
4/ Fill mandatory information and save.
5/ Go on the detail page of this record and verify the default value
exist.

Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-11 10:10:41 -03:00
20b842e7b0 Bug 13758: (QA followup) revert case change that broke the tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-07 14:12:14 -03:00
Mark Tompsett
c8d364ae72 Bug 14103: Improved testing coverage
As per Chris' comment #17, this improves the testing coverage.

Same test plan as comment #16, but add:

TEST PLAN SUPPLEMENT
--------------------
1) $ prove -v t/db_dependent/Borrower_Discharge.t
   -- notice only 5 tests, and generate_as_pdf not tested.
2) Apply this patch.
3) Retest as per comment #16
   -- this will test the error and no error cases
      tweaked in Koha/Borrower/Discharge.pm
4) remove PDF::HTML
   $ sudo apt-get purge libpdf-fromhtml-perl
5) $ prove -v t/db_dependent/Borrower_Discharge.t
   -- 7 tests, all successful
6) add PDF::HTML
   $ sudo dpkg -i /path/to/libpdf-fromhtml-perl...
   -- depends on how you get it. vary accordingly.
7) $ prove -v t/db_dependent/Borrower_Discharge.t
   -- 7 tests, all successful
   -- Note that is was a different 7th test. :)
8) koha qa test tools

Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-07 13:06:15 -03:00
Jonathan Druart
11049f9d02 Bug 13758: Move the Koha version from kohaversion.pl
It will permit not to run another perl interpreter.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-05-07 11:39:04 -03:00
Mark Tompsett
4e0468e8c2 Bug 14057: Inventory is painfully slow
This patch is a rough start. I believe it runs exponentially
faster, but its equality to the previous version needs to be
tested before I clean it up to acceptable standards.

Nested hashes of hashes was being a debugging nightmare.

Moved the SQL select to C4::Koha.

Changed the GetItemsForInventory to have a hashref parameter.
Added interface, in case there is a need for 'opac' vs. 'staff'.

Added t/db_dependent/Items/GetItemsForInventory.t
Added t/db_dependent/Koha/GetKohaAuthorisedValuesMapping.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-06 10:40:23 -03:00
Olli-Antti Kivilahti
0057fa933a Bug 12671: Guess next serial date when there are several issues per unit. Added support for real month and year lenghts.
When getting the next frequency number, use the real number of days for each month and each year.

Unit tests updated.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-05 15:22:10 -03:00
Julian Maurice
8b94c89f0b Bug 12671: Guess next serial date when there are several issues per unit
This guess uses the following algorithm
1/ Get the number of days remaining from first issue of this unit of
time until the end of the unit of time (using 7 days for week, 28 for
month and 365 for year)
2/ Divide it by the number of issues per unit
3/ Take the integer part of the result, this is the number of days to
add to previous serial published date

This patch also try to guess the date of the first issue of a unit of
time. Before that, it was:
- for week: monday of week
- for month: 1st day of month
- for year: 1st day of year
Now it uses firstacquidate.

Example:
  firstacquidate = 1970-01-07 (wednesday)
  unit = week
  issuesperunit = 2 (2 issues per week)

  From wednesday to sunday, there are 4 days so we add 2 days to get the
  next date.
  The next dates should be:
  - 1970-01-09 (+ 2 days)
  - 1970-01-14 (wednesday of next week)
  - 1970-01-16 (+ 2 days)
  - ... and so on

Test plan:
1/ Go to numbering pattern creation page (Serials -> Manager numbering
patterns -> New numbering pattern)
2/ In "Test prediction pattern" fieldset, set subscription length to 50
issues (this avoid to compute the next 1000 dates, which can take time)
3/ Fill first issue publication date
4/ Choose the frequency you want to test
5/ click on "Test pattern" button
6/ Check that the dates are correct
7/ Repeat steps 3-7 until you think you have tested enough cases

Interesting frequencies to test:
- 1/day
- 1/week
- 2/week
- 6/week (firstacquidate should be monday or tuesday, or the generated
  dates will be the same for all the week)
- 1/month
- 2/month
- 3/month
- 1/year
- 2/year
- 3/year

----------------
Sign off report:
----------------
-Followed the test plan. Unit tests work. Also trying some more strange
 frequencies with our librarians:
 5/year, 43/year, 10/year.
-Received all serials for a subscription and found no errors.
-Received some serials with frequency 2/month pre-patch, getting publication
 date as 1st of every month for each magazine. Having applied the patch,
 publication dates started working mid-subscription for new magazines.
-Works well and fine!
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-05 15:22:10 -03:00
ca167b32b4 Bug 12412: Add ability for plugins to convert arbitrary files to MARC from record staging tool
Many libraries would like to be able to import various types of files as
MARC records ( citations, csv files, etc ). We can add a new function to
the plugins system to allow that kind of behavior at a very custom
level.

Test Plan:
1) Ensure you have plugins enabled and configured correctly
2) Installed the attached version 2.00 of the Kitchen Sink plugin
3) Download the attached text file
4) Browse to "Stage MARC records for import"
5) Select the downloaded text file for staging
6) After uploading, you should see a new area "Transform file to MARC:",
   select "Example Kitchen-Sink Plugin" from the pulldown menu
7) Click 'Stage for import"
8) Click 'Manage staged records"
9) You should now see two new MARC records!

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described - interesting new feature.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-04 15:33:51 -03:00
Mark Tompsett
00faa967bd Bug 13889: Add unit tests
Previous commit was lacking test coverage of new function.

TEST PLAN
---------
1) Apply all the patches
2) prove -v t/db_dependent/Log.t
   -- should be success.
3) koha qa test tools

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-04 11:11:32 -03:00
Jonathan Druart
7c5c6b3ca9 Bug 11814: Fix existing tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 15:33:12 -03:00
Yohann Dufour
ea6c9f8e84 Bug 8007: Discharge - Add unit tests
Signed-off-by: Lucie <lucie.rousseaux@dracenie.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 12:33:59 -03:00
Jonathan Druart
7e8295841f Bug 13919: Make the tests pass fixing the number of tests
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-28 15:11:34 -03:00
b921cca242 Bug 13919: Unit Test
Tested both unit test patches together.
Without main patch applied: do not pass as expected / with main patch pass OK as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-28 15:11:27 -03:00
Jonathan Druart
20ec29eb19 Bug 12404: Allow equal sign '=' in the TT directive
Signed-off-by: Courret <scourret@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-27 10:43:23 -03:00
Jonathan Druart
70fac393c8 Bug 12404: Add new unit tests
These unit tests reflect the changes done in next patches.

Signed-off-by: Courret <scourret@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-27 10:43:23 -03:00
Jonathan Druart
a468e8cf7a Bug 12404: Add UT for marcrecord2csv
Verify that these unit tests pass before any changes and after applying
all patches.

Signed-off-by: Courret <scourret@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-27 10:43:22 -03:00
Mark Tompsett
c066a8ca2f Bug 14030 - Added tests for duplicates.
It seems that the id's are not really used, but rather
the subtags, types, and language related fields.

These tests check for duplicates.

TEST PLAN
---------
1) Apply both patches
2) prove -v t/db_dependent/Languages.t
   -- may fail if you have duplicates.
3) ./installer/data/mysql/updatedatabase.pl
   -- this will trigger the atomicupdate, which because of
      this tweak, will correct duplicates.
4) prove -v t/db_dependent/Languages.t
   -- should succeed.
5) Run the updatedatabase.pl script multiple times.
6) prove -v t/db_dependent/Languages.t
   -- should still succeed.
7) koha qa test tools.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No koha-qa errors, test run successfully, no more duplicates

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-24 09:55:54 -03:00
Jonathan Druart
a9ac14658d Bug 13606: Add tests and fix existing ones
Some tests were wrong and not executed in a transaction.
Lot of sessions were created in DB because the session was never
flushed.

TEST PLAN
---------
$ mysql ...
> delete from sessions;
^Z
$ prove -v t/db_dependent/BackgroundJob.t
...
$ fg
> select id from sessions;
-- There will be lots of ids (10, if I recall)
^Z
$ git bz apply 13606
...
$ prove -v t/db_dependent/BackgroundJob.t
...
$ fg
> select * from sessions;
-- there should only be the one orphaned job.
   You can tell it is correct by the "making new job".
> quit

Run the koha-qa test tools.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-04-23 13:18:49 -03:00
Jonathan Druart
9d025e65a8 Bug 10706: Delete saved_reports to be sure no reports existed
We need to be sure no report existed before launching the tests.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 16:27:30 -03:00
Jonathan Druart
cc8601f486 Bug 10706: Add test
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 16:27:29 -03:00
Jonathan Druart
46fbcaadf1 Bug 13419: (follow-up) fix call to set_userenv
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 14:59:10 -03:00
Jonathan Druart
9df787a22d Bug 13419: (follow-up) Add tests - remove existing shelves
Works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 14:59:09 -03:00
Jonathan Druart
8d39257de3 Bug 13419: Add tests
Test plan:
    prove t/db_dependent/Utils/Datatables_Virtualshelves.t
should return green

Tested together with follow-up, works as expected
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 14:59:07 -03:00