Fix unit tests when $wgEmailAuthentication is set to false
[lhc/web/wiklou.git] / tests / phpunit / includes / PreferencesTest.php
index 5e546ce..392ad08 100644 (file)
@@ -17,20 +17,23 @@ class PreferencesTest extends MediaWikiTestCase {
                $this->prefUsers['notauth']
                        ->setEmail( 'noauth@example.org' );
 
-               $this->prefUsers['auth']    = new User;
+               $this->prefUsers['auth'] = new User;
                $this->prefUsers['auth']
                        ->setEmail( 'noauth@example.org' );
                $this->prefUsers['auth']
                        ->setEmailAuthenticationTimestamp( 1330946623 );
 
                $this->context = new RequestContext;
-               $this->context->setTitle( Title::newFromText('PreferencesTest') );
+               $this->context->setTitle( Title::newFromText( 'PreferencesTest' ) );
        }
 
        protected function setUp() {
                parent::setUp();
 
-               $this->setMwGlobals( 'wgEnableEmail', true );
+               $this->setMwGlobals( array(
+                       'wgEnableEmail' => true,
+                       'wgEmailAuthentication' => true,
+               ) );
        }
 
        /**
@@ -44,6 +47,7 @@ class PreferencesTest extends MediaWikiTestCase {
                );
                $this->assertEquals( 'mw-email-none', $prefs['emailaddress']['cssclass'] );
        }
+
        /**
         * Placeholder to verify bug 34302
         * @covers Preferences::profilePreferences
@@ -55,6 +59,7 @@ class PreferencesTest extends MediaWikiTestCase {
                );
                $this->assertEquals( 'mw-email-not-authenticated', $prefs['emailaddress']['cssclass'] );
        }
+
        /**
         * Placeholder to verify bug 34302
         * @covers Preferences::profilePreferences
@@ -75,6 +80,7 @@ class PreferencesTest extends MediaWikiTestCase {
                        , $this->context
                        , $preferences
                );
+
                return $preferences;
        }
 }