And use a DBIx transaction instead.
Test plan:
prove that the test files modified by this patch are passing
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch create a Koha::Acquisition::Booksellers module and
Koha::Acquisition::Bookseller::Contract[s] modules.
All code in the acquisition module is adapted to use the CRUD methods of
Koha::Object[s].
The former C4 routines are removed.
Test plan:
Since a lot of files are impacted by this patch, try a complete
acquisition workflow and try to catch errors.
Be focused on bookseller and bookseller' contacts data.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
The current test for still-active contracts fails because it was written
with fixed dates, which already passed :-D
This patch calculates the current date, and uses it to generate a future
one, so the tests serve their purpose no matter what the current date is.
To test:
- Run:
$ prove t/db_dependent/Contract.t
=> FAIL: activeonly compares contractenddate with now(), and fails
because a fixed 2015-07-31 is writteng on the test data
- Apply the patch
- Run:
$ prove t/db_dependent/Contract.t
=> SUCCESS: the sample data has been calculated using the current date
and the tests pass.
- Sign off :-D
Edit: added missing use DateTime::Duration,
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
With this patch, the subroutines GetContract, GetContracts, AddContract, ModContract and DelContract uses DBIx::Class instead of C4::SQLHelper
Test plan:
1) Apply the patch
2) Execute the unit tests by launching:
prove t/db_dependent/Contract.t
3) The command has to be a success :
t/db_dependent/Contract.t .. ok
All tests successful.
Files=1, Tests=43, 2 wallclock secs ( 0.04 usr 0.01 sys + 1.49 cusr 0.05 csys = 1.59 CPU)
Result: PASS
4) Log on with a superlibrarian permission
5) Go on the page acqui/supplier.pl (Acquisitions > Button "New vendor")
6) Record a vendor with a nonzero "name"
7) Go on the page admin/aqcontract.pl (click on the "Contracts" item in the menu)
8) Click on the button "New" > "Contract" and record a new one
9) Verify the displayed data are correct about the contract
10) "Edit" the contract with different values and verify the data are updated
11) Click on "Delete" in order to delete the contract, verify the displayed data are correct but cancel the operation
12) Click on "New" > "Basket" and verify there is the created contract in field "Contract", then record a basket by selectioning the created contract
13) Verify the contract name displayed is correct
14) Record an active budget and a fund linked to this budget
15) Go on the new basket (Home > Acquisitions > Search the created vendor)
16) Click on "Add to basket" then "From a new (empty) record" and verify the displayed contract name is correct, then cancel
17) Click on "Delete this basket"
18) Click on "Contracts" (in the left menu) in order to go on aqcontract.pl, then "Delete" the created contract
19) The contract is not displayed anymore in the vendor page
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described following test plan.
Tested on top of Bug 12493
Tests pass
No koha-qa errors
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch are the unit tests of the previous patch
Test plan :
Same as the previous patch
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comments on previous patch
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>