Merge "(Bug 44192) Do not attempt to send a real e-mail in ApiAccountCreationTest"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 18 Feb 2013 10:11:04 +0000 (10:11 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 18 Feb 2013 10:11:04 +0000 (10:11 +0000)
1  2 
tests/phpunit/includes/api/ApiAccountCreationTest.php

@@@ -7,8 -7,14 +7,14 @@@
   */
  class ApiCreateAccountTest extends ApiTestCase {
        function setUp() {
+               global $wgHooks;
                parent::setUp();
                LoginForm::setCreateaccountToken();
+               $hooks = $wgHooks;
+               Hooks::clear( 'AlternateUserMailer' );
+               $hooks['AlternateUserMailer'] = array( function () { return false; } );
+               $this->setMwGlobals( array( 'wgHooks' => $hooks ) );
        }
  
        /**
         */
        function testInvalidEmail() {
                global $wgEnableEmail;
 -              if( !$wgEnableEmail ) {
 +              if ( !$wgEnableEmail ) {
                        $this->markTestSkipped( 'email is not enabled, so createaccount does not check it' );
                }
                $this->doApiRequest( array(