Bug 21692 - Koha::Account->new has no tests
Summary: Koha::Account->new has no tests
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jasmine Amohia
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2018-10-26 15:44 UTC by Martin Renvoize (ashimema)
Modified: 2020-01-06 20:15 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 21692: created a test for Koha::Account->new (1.77 KB, patch)
2019-01-17 03:37 UTC, Jasmine Amohia
Details | Diff | Splinter Review
Bug 21692: created a test for Koha::Account->new (1.82 KB, patch)
2019-01-17 20:01 UTC, David Nind
Details | Diff | Splinter Review
Bug 21692: created a test for Koha::Account->new (1.88 KB, patch)
2019-02-17 11:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21692: created a test for Koha::Account->new (1.88 KB, patch)
2019-02-19 19:35 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 21692: (QA follow-up) Enhance test for new (1.74 KB, patch)
2019-02-19 19:35 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 21692: (QA follow-up) Enhance test for new (1.87 KB, patch)
2019-02-19 20:01 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 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 (ashimema) 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 (ashimema) 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 (ashimema) 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 (ashimema) 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 (ashimema) 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 (kidclamp) 2019-02-22 15:06:12 UTC
Awesome work all!

Pushed to master for 19.05
Comment 11 Martin Renvoize (ashimema) 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 (lukeg) 2019-03-07 23:23:11 UTC
backported to 18.05.x for 18.05.11