Everything in the Koha namespace should be properly tested.. but Koha::Account has a number of methods that are missing corresponding tests.
These tests will go in t/db_dependent/Koha/Account.t This page may help: https://wiki.koha-community.org/wiki/Unit_Tests
Created attachment 84121 [details] [review] Bug 21692: created a test for Koha::Account->new Test plan: 1) Run test for /Koha/Account.t and confirm that all tests were successful
Created attachment 84154 [details] [review] Bug 21692: created a test for Koha::Account->new Test plan: 1) Run test for /Koha/Account.t and confirm that all tests were successful Signed-off-by: David Nind <david@davidnind.com>
Created attachment 85221 [details] [review] Bug 21692: created a test for Koha::Account->new Test plan: 1) Run test for /Koha/Account.t and confirm that all tests were successful Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This is a bit too minimal for what I was thinking.. we should test the failure case.. in the Koha::Account case the 'new' routine requires the patron_id to be passed and croaks on failure (really we should probably switch this to a Koha::Error object, but that's another story).. So, for tests I would hope to see a mini subtest which tests for two cases for now.. using Test::Warn to catch the croak in the no patron_id passed case and a positive outcome if patron_id is passed.. in reality 'new' should also fail if patron_id is incorrect, but again, that's a future piece.
I'll add the extra's here but leave some attribution... don't want to put off a new dev :)
Created attachment 85311 [details] [review] Bug 21692: created a test for Koha::Account->new Test plan: 1) Run test for /Koha/Account.t and confirm that all tests were successful Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 85312 [details] [review] Bug 21692: (QA follow-up) Enhance test for new Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 85313 [details] [review] Bug 21692: (QA follow-up) Enhance test for new Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Awesome work all! Pushed to master for 19.05
Always great to see test coverage increased :) Pushed to 18.11.x for 18.11.04
backported to 18.05.x for 18.05.11