*/
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(