Bug 13942

Summary: Testing the 'recordpayment' function in C4::Accounts
Product: Koha Reporter: Julian FIOL <julian.fiol>
Component: Test SuiteAssignee: Julian FIOL <julian.fiol>
Status: CLOSED FIXED QA Contact: Galen Charlton <gmcharlt>
Severity: trivial    
Priority: P5 - low CC: jonathan.druart, julian.maurice, kyle, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 13942 : Testing the 'recordpayment' function in C4::Accounts
Bug 13942 : Testing the 'recordpayment' function in C4::Accounts
Bug 13942 : Testing the 'recordpayment' function in C4::Accounts
[PASSED QA] Bug 13942 : Testing the 'recordpayment' function in C4::Accounts

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 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 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 2015-04-13 14:56:34 UTC
Tests pushed to master.

Good job Julian!