Opened 11 years ago
Closed 11 years ago
#26836 closed defect (bug) (fixed)
Use Mock PHPMailer during Installation for Unit Tests
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Unit Tests | Keywords: | has-patch |
Focuses: | Cc: |
Description
We install the mock PHPMailer class for use during unit tests, however, it's not currently used during bootstrap installation since this is done in a separate process.
Not doing this can result in mailer exceptions in environments that aren't properly configured for sending mail even though we don't want to actually send any during tests. This is the case on Travis CI for example, and is currently one more reason why AJAX unit tests fail (since they perform an installation during some tests that are marked for @runTestsInSeparateProcesses
.
The solution is simple, we already have a custom install script for bootstrapping tests, and we just need to inject the mock mailer there in the same way we do in bootstrap.php for the tests that aren't run in a separate process, see the attached patch.
In 26944: