Commit graph

625 commits

Author SHA1 Message Date
Yohann Dufour
1c2744a83f Bug 12627: SQLHelper replacement - C4::Suggestions
With this patch, the subroutines NewSuggestion and ModSuggestion use DBIx::Class instead of C4::SQLHelper.
Moreover, the tests and the .pl have been adapted.

Test plan:
1) Apply the patch.

2) Execute the unit tests by launching :
prove t/db_dependent/Suggestions.t

3) The result has to be a success without error or warning :
t/db_dependent/Suggestions.t .. ok
All tests successful.
Files=1, Tests=91,  2 wallclock secs ( 0.05 usr  0.01 sys +  1.65 cusr  0.09 csys =  1.80 CPU)
Result: PASS

4) Log in the intranet, create a suggestion and verify the created suggestion.

5) Edit a suggestion from the intranet and verify the suggestion is correctly modified.

6) Log in the OPAC and verify you can add a suggestion.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass, suggestion created on staff and opac,
suggestion edited without problems, no koha-qa errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script:
Also tested:
- adding suggestion from staff and OPAC
- edit suggestion from staff
- deleting suggestion from OPAC
- changing to a normal status (email got created)
- changing to a custom status (SUGGEST_STATUS)
- display of custom status in OPAC

No problems found.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 15:17:00 -03:00
1cabaa32b4 Bug 8836: (RM followup) unit tests should use the new API
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 11:09:14 -03:00
fe1461bcd8 Bug 11425: (maniac followup) remove diag from tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-04 19:22:07 -03:00
612769c3e7 Bug 11425: (followup) fix number of tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-04 19:20:34 -03:00
643a9cd0ca Bug 11425 [QA Followup] - Fix number of unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2014-11-04 19:10:28 -03:00
Jonathan Druart
3e3717a861 Bug 11425: Get column names using DBIX
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2014-11-04 19:10:28 -03:00
Julian Maurice
62aa8aeb92 Bug 11425: Add unit tests
package Koha::Item::Search::Field
function C4::SQLHelper::GetColumns
function C4::Items::SearchItems

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2014-11-04 19:10:28 -03:00
e0d20059e6 Bug 11126: (RM followup) remove diags from tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-04 18:59:42 -03:00
Jonathan Druart
659f7cd097 Bug 11126: qa follow-up
- use Modern::Perl;
- fix a typo
- remove an old comment

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-04 18:53:51 -03:00
6b2d2abb19 Bug 11126 - Make the holds system optionally give precedence to local holds
This feature will allow libraries to specify that, when an item is returned,
a local hold may be given priority for fulfillment even though it is
of lower priority in the list of unfilled holds.

This feature has three settings:
* LocalHoldsPriority, which enables the feature
* LocalHoldsPriorityPatronControl, which selects for either tha patron's
  home library, or the patron's pickup library for the hold
* LocalHoldsPriorityItemControl, which selects for either the item's
  holding library, or home library.

So, this feature can "give priority for filling holds to
patrons whose (home library|pickup library) matches the item's
(home library|holding library)"

Test Plan:
1) Apply this patch
2) Run t/db_dependent/Holds/LocalHoldsPriority.t

Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-04 18:53:37 -03:00
33d285599f Bug 10860 [QA Followup] - Fix misc issues
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-03 10:26:25 -03:00
Jonathan Druart
5e2cc5c958 Bug 12958: Set a fund owner to a fund hierarchy
This patch adds the ability to set an owner to a fund hierarchy
On editing a fund, if it has children, a new checkbox appears "Set this
owner to all children funds".
If checked, all the fund hierarchy will herit to this owner.
This will facilitate the fund owner modifications.

Test plan:
- Verify that the new checkbox only appears if the fund has at least a child.
- Create a consistent fund hierarchy, something like:
    fund1
      fund11
        fund111
      fund12
    fund2
      fund21
- Try to modify a fund owner without checking the checkbox. Verify the
  children have not been modified.
- Try to modify a fund owner with checking the checkbox. Verify all fund
  hierarchy has been modified.

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

It works as announced.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-31 16:18:49 -03:00
simith
b61ebfd0fa Bug 11876 [Unit test] Add a diff view to staged MARC Records
Unit test added

http://bugs.koha-community.org/show_bug.cgi?id=11876
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-31 14:25:18 -03:00
7b7a45269a Bug 13141: (QA Followup) Update number of unit tests
While updating the number of unit tests from 12 to 13,
the number of tests to skip due to a outdated version
of DBD::Mock was missed.

This patch retains the test number change, and corrects
the number of tests.

TEST PLAN
---------
1) prove -v t/db_dependent/ReportsGuided.t
   -- on an UBUNTU git (lacks DBD::Mock >= 1.45)
2) prove -v t/db_dependent/ReportsGuided.t
   -- on a DEBIAN git (has DBD::Mock >= 1.45)
3) compare results.
   -- skipped tests should be 8 (2 individual tests + 6 in the loop)
      under Ubuntu.
   -- non-skipped tests should align.
   -- everything should be 13 tests.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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@gmail.com>
2014-10-31 13:15:06 -03:00
Mark Tompsett
82c65678bf Bug 13141: Add ability for biblio_framework to be a dropdown in Guided Reports
By tweaking the GetReservedAuthorisedValues function in
C4::Reports::Guided, biblio_framework can be added as a dropdown
list into the guided reports parameters.

The change in C4/Reports/Guided.pm required a test, which is
found in t/db_dependent/ReportsGuided.t

Code was then added to reports/guided_reports.pl to build the
appropriate hash to trigger the proper dropdown list.

TEST PLAN
---------
1) Apply patch
2) prove -v t/db_dependent/ReportsGuided.t
   -- all should pass, this confirms that both
      C4/Reports/Guided.pm and this test file work.
3) Log into staff client
4) Reports
5) Create from SQL
6) Enter appropriate information like:
Report name: Test 13141
-- no need to change Report group or Report is public or Notes or Type
SQL:
SELECT CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',
     biblio.biblionumber,'\">',biblio.biblionumber,'</a>') AS
     BiblioNumbers, title, author, frameworkcode
FROM biblio
WHERE frameworkcode=<<Enter the frameworkcode|biblio_framework>>

7) Save report
8) Run report
   -- The parameter entry page should have a drop down of
      framework codes.
9) Select a framework code, and click Run the report
   -- The displayed SQL should have a "frameworkcode=" portion
      matching the selected framework.
10) Run the koha qa test tool.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Test plan followed successfully.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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@gmail.com>
2014-10-31 13:14:59 -03:00
eff8d1ab36 Bug 7162: (RM followup) fix the number of tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-30 00:47:13 -03:00
Jonathan Druart
a5b861b6de Bug 7162: (follow-up) Add unit tests for DelOrder
The unit tests did not take into account the new DB field.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Also all Acquisition related
patches.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-30 00:44:20 -03:00
Julian Maurice
59bcdb0b25 Bug 7162: Factorize code for order cancellation (QA fixes)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-30 00:44:16 -03:00
Julian Maurice
1f8c4453cb Bug 7162: Add unit tests for DelOrder
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-30 00:44:14 -03:00
Mark Tompsett
34d02c375f Bug 12916 - Missing Test to demonstrate warnings.
Modifying C4/Tags.pm should have tests.

TEST PLAN
---------
1) Apply this test patch only.
2) prove -v t/db_dependent/Tags.t
   -- should see two warnings.
3) Apply the first patch.
4) prove -v t/db_dependent/Tags.t
   -- no warnings.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-30 00:31:26 -03:00
68078b0ce7 Bug 12653: remaining prog reference in t/db_dependent/SuggestionEngine_ExplodedTerms.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-29 23:37:54 -03:00
3541fc3654 Bug 13088: (RM followup) add missing pref mock
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 12:07:46 -03:00
Jonathan Druart
3d61550e22 Bug 12830: Move the order-related code into Koha::Acquisition::Order
The C4::Acquisition module should be exploded in order to add
readability and maintainability to this part of the code.

This patch is a POC, it introduces a new Koha::Acquisition::Order module and put in
it the code from NewOrder and NewOrderItem.

Test plan:
1/ Create an order, modify it, receive it, cancel the receipt.
2/ Launch the prove command on all unit tests modified by this patch and
verify that all pass.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 11:10:36 -03:00
Jonathan Druart
0d4fee2615 Bug 5342: (qa-followup) FIX some issues
this patch:
- reintroduces the ISSN column
- fix a wording (already there before the main patch)
- fix the tests if a serial was already in late

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small change: Removed 2 tabs in claims.tt and fixed order
of ISSN/Issue number column descriptions as they were switched.

Note: The <order> tags are currently not stripped out of the
notice.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 10:07:44 -03:00
Jonathan Druart
7690cd5ad1 Bug 5342: Serial claiming improvements: add a counter
This patch adds a new DB field serial.claims_count
This field already exists for late orders. It makes sense to introduce
it for serial.

Test plan:
0/
 a) Does not apply the patch.
 b) Remove all your claimissues notices and be sure you have some serial issues
    in late.
 c) remove email address for the vendor you will use.
 d) remove email address for the logged in user.
 e) Export claims using the csv export => The selected issues will be
 marked as claimed.
 f) logout/login (to update the email address).
1/ Apply the patch and execute the updatedb entry.
2/ Go on the Serials > Claims page
3/ Verify that you get a warning message 'No claimissue notice defined'
4/ Verify the vendor list is correct (with the number of serial in late.
You should not get any changes here.
5/ Select one vendor and verify that the issue which was claimed before
has a claim count set to 1.
6/ Verify that you are not able to send notification to the vendor.
7/ Create a claimissue notice.
Something like:
  <<LibrarianFirstname>>
  <<LibrarianSurname>>
  The following issues are in late:
  <order><<biblio.title>>, <<biblio.author>> (<<biblio.serial>>)</order>
8/ Go on the Serials > Claims page, the warning message does not appear
anymore.
9/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for this vendor).
10/ Add an email for the vendor.
11/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for your user).
12/ Add an email address to your user
logout/login
13/ Select issues. Select a notice. And "Send notification".
You should get a happy message: the email has been sent!
14/ The email will contain the order tags if bug 12851 is not
pushed/applied.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, some small issues fixed in a follow-up.
Note: If you change the email address of your staff user, you will
have to log out and back in to make the change take effect.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 10:07:37 -03:00
Jonathan Druart
6c1e10db22 Bug 11007: Drop column aqorders.cancelledby
It seems that this column has never been used.

Test plan:
1/ Execute the updatedatabase entry.
2/ git grep cancelledby should not return occurrence in the code (except
in Koha/Schema/*
3/ prove t/db_dependent/Acquisition.t should return green.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I couldn't find any trace of this column being used.
Passes tests and QA script, updates all necessary files.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 09:31:14 -03:00
Katrin Fischer
76c904a735 Bug 9530: Follow-up - Fix t/db_dependent/Branch.t
Tests need to learn about the new fields in the branches table.

To test:
prove t/db_dependent/Branch.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 09:26:03 -03:00
0a53d5e6b6 Bug 12651: DOM indexing is the default
On the 23 July development meeting it was decided to formally deprecate
GRS-1 indexing mode for Zebra. This patch makes code fallback to DOM
on the remaining places. No behaviour change should be noticed, as DOM
has been the default for a while.

Regards

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Also checked running Makefile.PL

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-27 12:35:44 -03:00
Mark Tompsett
c4852dbb14 Bug 13084 [Master] - Improve t/db_dependent/Members.t test coverage
Added a MoveMemberToDeleted set of tests.

TEST PLAN
---------
1) prove -v t/db_dependent/Members.t
   -- all should pass.
2) Run koha QA tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-23 10:40:43 -03:00
7fafe2afb4 Bug 13115 - Holidays.t will fail some unit tests on Sundays
Due to the fact that Sunday is a repeating holiday in the example data
which is used for part but not all of Holidays.t, the last test will
fail on Sundays. The test is to see if today is *not* a special holiday
for MPL, but since it's already a repeating holiday, is_holiday will
return true rather than false.

Test Plan:
1) Wait until Sunday
2) prove t/db_dependent/Holidays.t
3) Note the failure
4) Apply this patch
5) Repeat step 2
6) Note there is no longer a failure

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Used my time machine... :)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-21 21:11:28 -03:00
f35cddf5f3 Bug 12801 - Unit Test
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-18 10:24:56 -03:00
Jonathan Druart
d85f29661b Bug 12874: A DB field without a default mapping is set to a default value on editing
If an item is edited and a field is not mapped to Koha, it is to 0 or
NULL (depending on the default value defined).

This patch adds a check on the mapping before editing the item. It there
is no mapping, the DB value is not erased.

Test plan:
1/ Edit an item and fill a value for a field
2/ Unmap this field
3/ Edit the item
4/ Verify that the value is not erased (using the MySQL CLI)

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-11 12:57:11 -03:00
171b4e24b3 Bug 12876: (followup) remove useless diags
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-23 21:26:35 -03:00
Jonathan Druart
9daef6fb53 Bug 12876: Improve unit tests for CanReserveBeCanceledFromOpac
This patch fix the subroutine name and add a restriction on the
arguments: both argument are mandatory!

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>
2014-09-23 20:46:57 -03:00
Rafal Kopaczka
e9eef04b95 Bug 12876 - Reserve in waiting/transfer status may be cancelled by user
User may cancel his own reservation at waiting or in transit status
through calling opac-modrequest.pl. Cancel button is disabled in
interface but possibility to cancel should be checked also in
opac-moderequest.pl, before calling CancelReserve().
Similar situation is with opac-modrequest-suspend.pl

This patch provides new soubroutine to chceck if user can cancel given
reserve. It's possible only when he's owner of hold and hold isn't in
transfer or waiting status.

Additionaly there are new test for this function in Reserves.t

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests, QA script and new tests.
Works as described, tested with:
.../cgi-bin/koha/opac-modrequest.pl?reserve_id=XXX

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-23 20:46:50 -03:00
b2839a7c9c Bug 11672: (followup) warnings tested
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-23 15:32:28 -03:00
b04f5ba8a0 Bug 11672: (regression test) get_report_areas gets tested
This patch introduces a unit test for the new get_report_areas functionality.

To try it, run
  $ prove t/db_dependent/Reports_Guided.t

It is expected to have 16 tests defined, and to fail the introduced one

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-23 15:32:13 -03:00
Jonathan Druart
81b9d8b8aa Bug 12953: FIX NewOrder test
The patch for bug 12827 has been written some days before bug 10402. One
occurrence of NewOrder has not been modified.

Test plan:
  prove t/db_dependent/Letters.t

should return green.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-18 10:10:17 -03:00
Julian Maurice
45f474abdf Bug 8868: ILS-DI: CancelHold needs to take a reserve_id
CancelHold takes two parameters: patron_id and item_id.
If item_id is considered as an itemnumber, holds on title can't be
canceled.
If item_id is considered as a biblionumber, all holds on this
biblionumber (for a borrower) will be canceled.

So CancelHold have to consider item_id as a reserve_id.

- Added subroutine C4::Reserves::GetReserve
- C4::ILSDI::Services::GetRecords now returns the reserve_id
- Fix the text in the ilsdi.pl?service=Describe&verb=CancelHold page
- Unit tests for CancelReserved and GetReserve
- Do not delete row in reserves table if insert in old_reserves fails

Signed-off-by: Leila and Sonia <koha.aixmarseille@gmail.com>
Signed-off-by: Benjamin Rokseth <bensinober@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signing off, while noting a style issue in the patch review

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Placed and cancelled a hold using ILS-DI successfully.
Adding a follow-up to also update the ils-di documentation
page in the bootstrap theme.

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

EDIT: I removed the changes it did to the prog theme.
2014-09-18 09:48:41 -03:00
Jonathan Druart
e2b0454ed4 Bug 12609: Add some unit tests for C4::Ratings
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>
2014-09-17 22:08:57 -03:00
Jonathan Druart
5af96e0f78 Bug 12827: NewOrder needs more unit tests
NewOrder should be more tested!

This patch moves the existing unit tests into a new file and adds some
unit tests.

Note that there is no DB field aqorders.subscription, so the test in
NewOrder can be removed.

Test plan:
  prove t/db_dependent/Acquisition/NewOrder.t
and
  prove t/db_dependent/Acquisition.t
should return green.

Signed-off-by: Zeno Tajoli <z.tajoli@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 21:22:56 -03:00
Jonathan Druart
2217f98b7c Bug 12827: NewOrder should not return basketno
Since the basketno parameter is needed to insert an order, it is useless
to return it.

This patch changes the prototype for the C4::Acquisition::NewOrder
subroutine. The return value is now a scalar containing the ordernumber
created.

Test plan:
Verify there is no regression on an acquisition workflow:
1/ Create an order with several items
2/ Modify the order
3/ Receive some items
4/ Cancel the receipt
4/ Receive some items
5/ Receive all remaining items
6/ Cancel the receipt

Signed-off-by: Zeno Tajoli <z.tajoli@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 21:22:26 -03:00
Jonathan Druart
55e5c82ab5 Bug 12891: NewOrder does not return ordernumber if ordernumber is defined
The behavior is quite weird, but
  $schema->resultset('Table')->create($data)->id
does not return the id inserted if $data contains the key.

To be more clear, in this case
  $schema->resultset('Aqorder')->create($new_order)->id
returns an empty string because $new_order->{ordernumber} is an empty
string!

This was not caught by the unit tests, I added one.

Test plan:
- AcqCreateItem set to ordering
- Create an order with items and verify items are correctly linked to the
  order.

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed that without the patch the created item is not linked to the
order (entry in aqorders_items). With the patch, it works as expected.
Passes tests and Koha QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 21:19:35 -03:00
84548dcba9 Bug 11577 : Fixing a tiny copy/paste issue
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 19:23:37 -03:00
Holger Meißner
904b35645c Bug 11577: Unit tests
This patch fixes two unit tests that broke because of the new feature.
Also adds some new test cases.

To test:

1) prove t/db_dependent/Circulation.t
2) prove t/db_dependent/Circulation_Issuingrule.t

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-17 19:23:26 -03:00
84b4ace746 Bug 12879: Remove unnecesary diags from Holds.t
There are two unnecessary diag statements:
- Creating biblio instance for testing.
- Creating item instance for testing.

TEST PLAN
---------
1) prove t/db_dependent/Holds.t

t/db_dependent/Holds.t .. 1/38 # Creating biblio instance for testing.
Use of uninitialized value in subroutine entry at /home/tcohen/git/koha-community-src/C4/Charset.pm line 181.
 # Creating item instance for testing.
Use of uninitialized value in subroutine entry at /home/tcohen/git/koha-community-src/C4/Charset.pm line 181.
Use of uninitialized value in subroutine entry at /home/tcohen/git/koha-community-src/C4/Charset.pm line 181.
t/db_dependent/Holds.t .. ok
All tests successful.
Files=1, Tests=38,  1 wallclock secs ( 0.03 usr  0.01 sys +  1.13 cusr  0.11 csys =  1.28 CPU)
Result: PASS

-- They are in the first and fourth lines of this sample output

2) apply patch
3) prove t/db_dependent/Holds.t

t/db_dependent/Holds.t .. 1/38 Use of uninitialized value in subroutine entry at /home/mtompset/kohaclone/C4/Charset.pm line 186.
Use of uninitialized value in subroutine entry at /home/mtompset/kohaclone/C4/Charset.pm line 186.
Use of uninitialized value in subroutine entry at /home/mtompset/kohaclone/C4/Charset.pm line 186.
t/db_dependent/Holds.t .. ok
All tests successful.
Files=1, Tests=38,  1 wallclock secs ( 0.01 usr  0.00 sys +  0.78 cusr  0.09 csys =  0.88 CPU)
Result: PASS

-- They are no longer in the first and fourth lines of this sample output

4) run koha QA test tool

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-16 15:21:40 -03:00
Robin Sheat
8a63c17f79 Bug 12918: fix failing test case
A bug in a test case causes test case failure. It also required a
database, so I'm moving it out of the way.

Test plan:
1) prove -v t/db_dependent/Templates.t
   -- bombs!
2) apply patch
3) prove -v t/db_dependent/Templates.t
   -- works!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Good catch Robin, it didn't fail in Perl 5.18 so didn't notice the mistake.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-15 10:53:00 -03:00
cc063de044 Bug 12898: (regression test) test terms inside double quotes
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-14 02:02:51 -03:00
Jonathan Druart
10622af499 Bug 10226: Add unit tests for GetReservesFromItemnumber
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-14 02:02:51 -03:00
Jonathan Druart
a2786c6de7 Bug 12557: Partially received - the change should affect the new order
If the receipt in not on the whole order but only on a part of it, the
change should be done on the itemnumber linked to the "new order", the
one we are reverting.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-09 10:10:22 -03:00