Bug 21692

Summary: Koha::Account->new has no tests
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Test SuiteAssignee: Jasmine Amohia <jasmineamohia.student>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: aleisha, fridolin.somers, jasmineamohia.student, lucas, nick
Version: masterKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 21692: created a test for Koha::Account->new
Bug 21692: created a test for Koha::Account->new
Bug 21692: created a test for Koha::Account->new
Bug 21692: created a test for Koha::Account->new
Bug 21692: (QA follow-up) Enhance test for new
Bug 21692: (QA follow-up) Enhance test for new

Description Martin Renvoize 2018-10-26 15:44:22 UTC
Everything in the Koha namespace should be properly tested.. but Koha::Account has a number of methods that are missing corresponding tests.
Comment 1 Aleisha Amohia 2019-01-16 22:42:01 UTC
These tests will go in t/db_dependent/Koha/Account.t
This page may help: https://wiki.koha-community.org/wiki/Unit_Tests
Comment 2 Jasmine Amohia 2019-01-17 03:37:52 UTC
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
Comment 3 David Nind 2019-01-17 20:01:36 UTC
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>
Comment 4 Katrin Fischer 2019-02-17 11:44:40 UTC
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>
Comment 5 Martin Renvoize 2019-02-19 12:08:52 UTC
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.
Comment 6 Martin Renvoize 2019-02-19 19:17:15 UTC
I'll add the extra's here but leave some attribution... don't want to put off a new dev :)
Comment 7 Martin Renvoize 2019-02-19 19:35:17 UTC
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>
Comment 8 Martin Renvoize 2019-02-19 19:35:20 UTC
Created attachment 85312 [details] [review]
Bug 21692: (QA follow-up) Enhance test for new

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2019-02-19 20:01:00 UTC
Created attachment 85313 [details] [review]
Bug 21692: (QA follow-up) Enhance test for new

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Nick Clemens 2019-02-22 15:06:12 UTC
Awesome work all!

Pushed to master for 19.05
Comment 11 Martin Renvoize 2019-02-26 09:31:51 UTC
Always great to see test coverage increased :)

Pushed to 18.11.x for 18.11.04
Comment 12 Lucas Gass 2019-03-07 23:23:11 UTC
backported to 18.05.x for 18.05.11