https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18086
Baptiste Wojtkowski (bwoj) <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com --- Comment #27 from Baptiste Wojtkowski (bwoj) <[email protected]> --- Hello ! I have been working a bit on this bug and I have a few conclusions, I'll address them in patches following this message First, is is on of my first contribution to a non trivial patch so please tell me if I do some things wrong :) In particular, I did not found the information if tests should consider the db empty or pupulated with populate_database so I ran the tests with an empty db. 1 - I reproduce https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18086#c20 , this is due to the foreign key constraint cor categories if 'PT' and 'YA' are not set. I populate the db with these entries. See the dedicated patch for more information. 2 - I do think GetOverdueMessageTransportTypes does not have the correct behaviour with the new patch so we should correct the function and not the test for these tests. # Failed test 'GetOverdueMessageTransportTypes: first overdue is by email for PT (CPL)' # at t/db_dependent/Overdues.t line 124. # Structures begin differing at: # $got->[1] = 'sms' # $expected->[1] = Does not exist helloCPLPT2 at /home/koha/src/C4/Overdues.pm line 769. # Failed test 'GetOverdueMessageTransportTypes: second overdue is by sms for PT (CPL)' # at t/db_dependent/Overdues.t line 127. # Structures begin differing at: # $got->[0] = 'email' # $expected->[0] = 'sms' helloCPLPT3 at /home/koha/src/C4/Overdues.pm line 769. # Failed test 'GetOverdueMessageTransportTypes: third overdue is by email for PT (CPL)' # at t/db_dependent/Overdues.t line 130. # Structures begin differing at: # $got->[1] = 'sms' # $expected->[1] = Does not exist # Looks like you failed 3 tests of 9. I think this is a bug due to "GetOverdueMessageTransportTypes" returning ['email', 'sms', 'email'] in all these three tests, instead of returning ['email'], then ['sms'], and then ['email'] Indeed, Koha::Overdue->getmessagetransporttype returns every entries related to one given rule id, which may have multiple letternumbers, which are not taken anymore in account at this point of the code. I am not sure of the purpose of Koha::Overdue->getmessagetransporttype but i would delete it and directly use the join (not proposed in this patch). 3 - A few tests do not pass because they test the behaviour of functions concerning branches on an empty string, which is now forbidden due to the foreign key constraint. I propose changes for branches and for categories in two different patches, changing the behaviour of functions so that they interprete NULL in db as the default rule. WARNING: Tests seem to pass but I am not sure if coverage is sufficient to guarantee the NULL does not break much things. 4 - A few tests do not pass because they test the behaviour of functions concerning categories on an empty string, which is now forbidden due to the foreign key constraint. Moreover it is forbidden for a categorie to be NULL in overduerules, I remove the constraint there too. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
