Last modified: 2013-04-22 16:14:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46192, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44192 - ApiCreateAccountTest::testValid() sends confirmation mail to invalid address
ApiCreateAccountTest::testValid() sends confirmation mail to invalid address
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Tyler Romeo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-20 15:36 UTC by Alexandre Emsenhuber [IAlex]
Modified: 2013-04-22 16:14 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Alexandre Emsenhuber [IAlex] 2013-01-20 15:36:15 UTC
When $wgEmailAuthentication is set to true, ApiCreateAccountTest::testValid() sends e-mail address confirmation mail to invalid address test@domain.test.

It is very annoying to receive a "Delivery Status Notification" mail from my provider saying that the e-mail address mentioned above is invalid.
Comment 1 Tyler Romeo 2013-01-20 19:24:12 UTC
Are there any unit tests that legitimately need email to be sent? Or would it be fine to simply just add an if statement to User::sendMail to not send mail in the case of unit tests.
Comment 2 Alexandre Emsenhuber [IAlex] 2013-01-20 19:33:58 UTC
To easiest to me seems to remove the e-mail address from the request when creating the account; I don't like the idea to have a special case for unit tests in User or UserMailer.
Comment 3 Tyler Romeo 2013-01-20 19:52:45 UTC
OK, but then if $wgEmailConfirmToEdit is turned on, then the test just fails.
Comment 4 Alexandre Emsenhuber [IAlex] 2013-01-20 20:28:38 UTC
Setting 'email' => '', on line 54 works well for me.
Comment 5 Tyler Romeo 2013-01-21 06:51:02 UTC
If you give an empty email when $wgEmailConfirmToEdit is set to true, a UsageException will be thrown saying the email parameter must be set. Switching from dependence on one configuration variable to another doesn't really fix the problem.
Comment 6 Alexandre Emsenhuber [IAlex] 2013-01-21 08:21:37 UTC
Oh yes, I forgot about $wgEmailConfirmToEdit...

In this case the easiest seems to force $wgEmailAuthentication to false so that it won't send any mail away during the tests.
Comment 7 Mark A. Hershberger 2013-01-21 13:27:41 UTC
(In reply to comment #6)
> In this case the easiest seems to force $wgEmailAuthentication to false so
> that it won't send any mail away during the tests.

I've opened Bug 44206 to stub out email handling.
Comment 8 Platonides 2013-02-09 21:50:18 UTC
Gerrit change #48247
Comment 9 db [inactive,noenotif] 2013-02-21 20:43:33 UTC
(In reply to comment #8)
> Gerrit change #48247

Status Merged
Comment 10 Antoine "hashar" Musso (WMF) 2013-02-28 21:48:14 UTC
reverted with https://gerrit.wikimedia.org/r/#/c/49638/
Comment 11 Antoine "hashar" Musso (WMF) 2013-02-28 22:22:16 UTC
Generic solution to disable all email: https://gerrit.wikimedia.org/r/#/c/51576/
Comment 12 Umherirrender 2013-03-01 20:07:59 UTC
(In reply to comment #11)
> Generic solution to disable all email:
> https://gerrit.wikimedia.org/r/#/c/51576/

successfully merged

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links