Bug 20474

Summary: Passwordrecovery.t should mock Mail::Sendmail::sendmail
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: martin.renvoize, mtompset, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18570    
Bug Blocks:    
Attachments: Bug 20474: Explicitly call sendmail to make mocking work
Bug 20474: Mock sendmail instead of actually emailing
Bug 20474: Explicitly call sendmail to make mocking work
Bug 20474: Mock sendmail instead of actually emailing
Bug 20474: Mimick Letters.t

Description Jonathan Druart 2018-03-26 14:54:10 UTC
Since bug 18570, sendmail is used directly from Passwordrecovery.t.
We should mock it, like we do in Letters.t
Comment 1 Mark Tompsett 2018-03-26 16:52:49 UTC
Created attachment 73288 [details] [review]
Bug 20474: Explicitly call sendmail to make mocking work
Comment 2 Mark Tompsett 2018-03-26 16:52:52 UTC
Created attachment 73289 [details] [review]
Bug 20474: Mock sendmail instead of actually emailing

Copy mocking sendmail code from t/db_dependent/Letters.t
into the Passwordrecovery.t test file.

prove t/db_dependent/Passwordrecovery.t
Comment 3 Jonathan Druart 2018-03-27 15:24:01 UTC
Created attachment 73322 [details] [review]
Bug 20474: Explicitly call sendmail to make mocking work

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Jonathan Druart 2018-03-27 15:24:05 UTC
Created attachment 73323 [details] [review]
Bug 20474: Mock sendmail instead of actually emailing

Copy mocking sendmail code from t/db_dependent/Letters.t
into the Passwordrecovery.t test file.

prove t/db_dependent/Passwordrecovery.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2018-03-27 15:24:08 UTC
Created attachment 73324 [details] [review]
Bug 20474: Mimick Letters.t

Please improve if needed the 2 occurrences on a separate bug reports.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2018-03-27 16:43:33 UTC
Skipping QA to make Jenkins happy quickly.
Comment 7 Jonathan Druart 2018-03-27 16:44:04 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 8 Nick Clemens 2018-04-24 01:36:17 UTC
Awesome work all, backported to stable for 17.11.05