r113016 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113015‎ | r113016 | r113017 >
Date:11:48, 5 March 2012
Author:hashar
Status:resolved (Comments)
Tags:
Comment:
place holder to test bug 34919 when it is fixed
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/PreferencesTest.php (added) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/PreferencesTest.php
@@ -0,0 +1,71 @@
 2+<?php
 3+
 4+class PreferencesTest extends MediaWikiTestCase {
 5+
 6+ /** Array of User objects */
 7+ private $users ;
 8+ private $context ;
 9+
 10+ function __construct() {
 11+ parent::__construct();
 12+
 13+ $this->users['noemail'] = new User;
 14+
 15+ $this->users['notauth'] = new User;
 16+ $this->users['notauth']
 17+ ->setEmail( 'noauth@example.org' );
 18+
 19+ $this->users['auth'] = new User;
 20+ $this->users['auth']
 21+ ->setEmail( 'noauth@example.org' );
 22+ $this->users['auth']
 23+ ->setEmailAuthenticationTimestamp( 1330946623 );
 24+
 25+ $this->context = new RequestContext;
 26+ $this->context->setTitle( Title::newFromText('PreferencesTest') );
 27+ }
 28+
 29+ /**
 30+ * Placeholder to verify bug 34919
 31+ * @covers Preferences::profilePreferences
 32+ */
 33+ function testEmailFieldsWhenUserHasNoEmail() {
 34+ $prefs = $this->prefsFor( 'noemail' );
 35+ $this->assertArrayNotHasKey( 'class',
 36+ $prefs['emailaddress']
 37+ );
 38+ }
 39+ /**
 40+ * Placeholder to verify bug 34919
 41+ * @covers Preferences::profilePreferences
 42+ */
 43+ function testEmailFieldsWhenUserEmailNotAuthenticated() {
 44+ $prefs = $this->prefsFor( 'notauth' );
 45+ $this->assertArrayNotHasKey( 'class',
 46+ $prefs['emailaddress']
 47+ );
 48+ }
 49+ /**
 50+ * Placeholder to verify bug 34919
 51+ * @covers Preferences::profilePreferences
 52+ */
 53+ function testEmailFieldsWhenUserEmailIsAuthenticated() {
 54+ $prefs = $this->prefsFor( 'auth' );
 55+ $this->assertArrayNotHasKey( 'class',
 56+ $prefs['emailaddress']
 57+ );
 58+ }
 59+
 60+
 61+ /** Helper */
 62+ function prefsFor( $user_key ) {
 63+ $preferences = array();
 64+ Preferences::profilePreferences(
 65+ $this->users[$user_key]
 66+ , $this->context
 67+ , $preferences
 68+ );
 69+ return $preferences;
 70+ }
 71+
 72+}
Property changes on: trunk/phase3/tests/phpunit/includes/PreferencesTest.php
___________________________________________________________________
Added: svn:eol-style
173 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r113017amend r113016 , that was for bug 34302hashar11:50, 5 March 2012
r113221(bug 34302) Add CSS classes to email fields in user preferences...hashar09:56, 7 March 2012

Comments

#Comment by Hashar (talk | contribs)   11:49, 5 March 2012

Bug 34302 - Add email-verified or email-not-verified class to email options

Status & tagging log