Bug 20474 - Passwordrecovery.t should mock Mail::Sendmail::sendmail
Summary: Passwordrecovery.t should mock Mail::Sendmail::sendmail
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Mark Tompsett
QA Contact: Testopia
URL:
Keywords:
Depends on: 18570
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-26 14:54 UTC by Jonathan Druart
Modified: 2019-10-14 19:56 UTC (History)
3 users (show)

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


Attachments
Bug 20474: Explicitly call sendmail to make mocking work (1.89 KB, patch)
2018-03-26 16:52 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20474: Mock sendmail instead of actually emailing (2.59 KB, patch)
2018-03-26 16:52 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20474: Explicitly call sendmail to make mocking work (1.97 KB, patch)
2018-03-27 15:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20474: Mock sendmail instead of actually emailing (2.67 KB, patch)
2018-03-27 15:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20474: Mimick Letters.t (1.93 KB, patch)
2018-03-27 15:24 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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