Created attachment 18185 [details] [review] Bug 10270: GetOrdersByBiblionumber needs better unit tests prove t/db_dependent/Acquisition/GetOrdersByBiblionumber.t
Created attachment 18186 [details] [review] Bug 10270: GetOrdersByBiblionumber needs better unit tests prove t/db_dependent/Acquisition/GetOrdersByBiblionumber.t
Thank you Jonathan, that looks GREAT! I am going to test it right now. Mathieu
I made 2 tests : $prove -v t/db_dependent/Acquisition/GetOrdersByBiblionumber.t t/db_dependent/Acquisition/GetOrdersByBiblionumber.t .. ok 1 - GetOrdersByBiblionumber : no argument, return undef ok 2 - 1 order on biblionumber 1 ok 3 - 2 orders on biblionumber 2 1..3 ok All tests successful. Files=1, Tests=3, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.36 cusr 0.03 csys = 0.41 CPU) Result: PASS and $prove -v t/db_dependent/Acquisition.t t/db_dependent/Acquisition.t .. 1..37 [...] All tests successful. Files=1, Tests=37, 1 wallclock secs ( 0.01 usr 0.01 sys + 0.36 cusr 0.04 csys = 0.42 CPU) Result: PASS I sign off.
Created attachment 18188 [details] [review] [SIGNED OFF][PATCH] Bug 10270: GetOrdersByBiblionumber needs better unit tests
Created attachment 18192 [details] [review] Bug 10270: GetOrdersByBiblionumber needs better unit tests prove t/db_dependent/Acquisition/GetOrdersByBiblionumber.t
typo in the last patch: -use C4::Biblio qw( AddBiblio ); +use C4::Biblio; [...] -( undef, $ordernumber2 ) = C4::Acquisition::NewOrder( +( undef, $ordernumber3 ) = C4::Acquisition::NewOrder(
However, it worked. Need to be tested again? Mathieu
Needs SO
Created attachment 18202 [details] [review] [SIGNED OFF][PATCH] Bug 10270: GetOrdersByBiblionumber needs better unit tests Tested again. The 2 test files Acquisition/GetOrdersByBiblionumber.t and Acquisition.t are successful. Mathieu
Jonathan, a question about: +++ b/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t @@ -0,0 +1,84 @@ +#!/usr/bin/env perl Why use env perl instead of perl? Note that we only use env perl in 6 Koha files (2 in the test directory t). I understand that it is more portable. But then we should do it more often.. All our scripts contain the fixed perl path. Just for consistency.
(In reply to comment #11) > Jonathan, a question about: > > +++ b/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t > @@ -0,0 +1,84 @@ > +#!/usr/bin/env perl > > Why use env perl instead of perl? Note that we only use env perl in 6 Koha > files (2 in the test directory t). > I understand that it is more portable. But then we should do it more often.. > All our scripts contain the fixed perl path. > Just for consistency. There is no specific reason, I thought it is a good practice. A patch coming...
Created attachment 18204 [details] [review] Bug 10270: Fix shebang Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 18222 [details] [review] [PASSED QA] Bug 10270: GetOrdersByBiblionumber needs better unit tests prove t/db_dependent/Acquisition/GetOrdersByBiblionumber.t Signed-off-by:Mathieu Saby <mathieu.saby@univ-rennes2.fr> I made 2 tests : $prove -v t/db_dependent/Acquisition/GetOrdersByBiblionumber.t and $prove -v t/db_dependent/Acquisition.t The 2 tests are successful. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests and QA script pass.
Created attachment 18223 [details] [review] [PASSED QA] Bug 10270: Fix shebang Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This patch has been pushed to master and 3.12.x.