Bug 13942 - Testing the 'recordpayment' function in C4::Accounts
Summary: Testing the 'recordpayment' function in C4::Accounts
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Julian FIOL
QA Contact: Galen Charlton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-02 09:57 UTC by Julian FIOL
Modified: 2015-12-03 22:11 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 13942 : Testing the 'recordpayment' function in C4::Accounts (7.08 KB, patch)
2015-04-02 10:00 UTC, Julian FIOL
Details | Diff | Splinter Review
Bug 13942 : Testing the 'recordpayment' function in C4::Accounts (7.13 KB, patch)
2015-04-02 13:53 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 13942 : Testing the 'recordpayment' function in C4::Accounts (7.17 KB, patch)
2015-04-09 07:52 UTC, Julian FIOL
Details | Diff | Splinter Review
[PASSED QA] Bug 13942 : Testing the 'recordpayment' function in C4::Accounts (7.24 KB, patch)
2015-04-10 12:39 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian FIOL 2015-04-02 09:57:36 UTC
Testing the 'recordpayment' function in C4::Accounts
    
    TEST PLAN
    ---------
    
    1. Apply patch
    2. prove -v t/db_dependent/Accounts.t
    -- All 15 tests should run successfully without any error or warning
Comment 1 Julian FIOL 2015-04-02 10:00:30 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-04-02 13:53:25 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall (khall) 2015-04-03 14:39:22 UTC
I received the following when I ran the unit tests with an installation using the sample data:
prove -v t/db_dependent/Accounts.t
t/db_dependent/Accounts.t ..
1..15
ok 1 - use C4::Accounts;
ok 2 - use Koha::Object;
ok 3 - use Koha::Borrower;
ok 4 - use Data::Dumper;
ok 5 - C4::Accounts->can(...)
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_kohaqa`.`issues`, CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON UPDATE CASCADE) at t/db_dependent/Accounts.t line 53.
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_kohaqa`.`issues`, CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON UPDATE CASCADE) at t/db_dependent/Accounts.t line 53.
# Looks like you planned 15 tests but ran 5.
# Looks like your test exited with 255 just after 5.
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 10/15 subtests

Test Summary Report
-------------------
t/db_dependent/Accounts.t (Wstat: 65280 Tests: 5 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 15 tests but ran 5.
Files=1, Tests=5,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.46 cusr  0.04 csys =  0.52 CPU)
Result: FAIL
Comment 4 Jonathan Druart 2015-04-09 07:39:01 UTC
(In reply to Kyle M Hall from comment #3)
> I received the following when I ran the unit tests with an installation
> using the sample data:
> prove -v t/db_dependent/Accounts.t
> t/db_dependent/Accounts.t ..
> 1..15
> ok 1 - use C4::Accounts;
> ok 2 - use Koha::Object;
> ok 3 - use Koha::Borrower;
> ok 4 - use Data::Dumper;
> ok 5 - C4::Accounts->can(...)
> DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign
> key constraint fails (`koha_kohaqa`.`issues`, CONSTRAINT `issues_ibfk_1`
> FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON
> UPDATE CASCADE) at t/db_dependent/Accounts.t line 53.

This is because you have issues in your DB, so not the default sample data :)
But this needs to be fixed anyway.
Comment 5 Julian FIOL 2015-04-09 07:52:45 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall (khall) 2015-04-10 12:39:41 UTC
Created attachment 37645 [details] [review]
[PASSED QA] Bug 13942 : Testing the 'recordpayment' function in C4::Accounts

for Kyle M Hall : Adding removal of the 'issues' table

TEST PLAN
---------

1. Apply patch
2. prove -v t/db_dependent/Accounts.t
-- All 15 tests should run successfully without any error or warning

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Tomás Cohen Arazi (tcohen) 2015-04-13 14:56:34 UTC
Tests pushed to master.

Good job Julian!