Page MenuHomePhabricator

Expand phpunit tests for User.php
Open, MediumPublic

Description

Currently, only 40.50% of the functions and methods, and 36.65% of the lines of code in the User class are tested

Was: 10.68% of functions and methods and 14.94% of the lines of code

Progress

During this task, the following methods, which were previously untested, had tests added:

  • ::getTalkPage, ::getUserPage, ::getTitleKey
  • ::getBlockId, ::isAllowedToCreateAccount, ::isBlockedFromEmailuser, ::isBlockedFromUpload
  • ::getGroups, ::getGroupMemberships, ::isBot
  • ::newFromName, ::newFromSession, ::newFromRow, ::newFromId, ::newFromConfirmationCode
  • ::getName, ::setName
  • ::getRealName, ::setRealName
  • ::getEmail, ::setEmail, ::invalidateEmail, ::setEmailWithConfirmation
  • ::getRequest, ::loadFromRow
  • ::isWatched, ::addWatch, ::removeWatch
  • ::getDefaultOption, ::getBoolOption, ::getIntOption
  • ::getStubThreshold, ::requiresHTTPS
  • ::setItemLoaded, ::isItemLoaded
  • ::isCreatableName, ::isUsableName
  • ::changeableGroups
  • ::isAllowedAny, ::isAllowedAll, ::isAllowed, ::isNewbie
  • ::useRCPatrol, ::useNPPatrol, ::useFilePatrol, ::pingLimiter
  • ::validateCache, ::getTouched, ::getDBTouched
  • ::logout, ::setId, ::whoIs, ::addToDatabase, ::setEditCountInternal

Testing was also expanded for:

  • ::incEditCount, ::getId
  • ::getCanonicalName
  • ::getDefaultOptions
  • ::addGroup, ::removeGroup
  • ::idFromName
  • ::findUsersByGroup
  • ::checkPasswordValidity

Event Timeline

Restricted Application added a project: User-DannyS712. · View Herald TranscriptSep 20 2019, 3:01 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 538135 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Expand testing for User class

https://gerrit.wikimedia.org/r/538135

DannyS712 triaged this task as Medium priority.Sep 20 2019, 7:13 AM
DannyS712 added a project: Contributors-Team.
DannyS712 moved this task from Unsorted to Awaiting review and deployment on the User-DannyS712 board.

Tagging Contributors-Team for code review, per https://www.mediawiki.org/wiki/Developers/Maintainers. The patch adds just over a hundred lines of coverage, and is pretty straight forward, so hopefully it'll be easy to review. +2 verified from Jenkins.

Change 538135 merged by jenkins-bot:
[mediawiki/core@master] Expand testing for User class

https://gerrit.wikimedia.org/r/538135

Now 20.40% of functions and methods, and 23.99% of lines

Change 553447 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Expand watchlist-related tests for User class

https://gerrit.wikimedia.org/r/553447

DannyS712 updated the task description. (Show Details)Nov 29 2019, 7:17 AM

Change 553447 merged by jenkins-bot:
[mediawiki/core@master] Expand watchlist-related tests for User class

https://gerrit.wikimedia.org/r/553447

Change 559432 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Expand options-related tests for User class

https://gerrit.wikimedia.org/r/559432

DannyS712 updated the task description. (Show Details)Dec 19 2019, 9:27 PM
DannyS712 updated the task description. (Show Details)Dec 19 2019, 10:10 PM

Change 559432 merged by jenkins-bot:
[mediawiki/core@master] Expand options-related tests for User class

https://gerrit.wikimedia.org/r/559432

DannyS712 updated the task description. (Show Details)Jan 4 2020, 9:34 AM

Change 561961 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add more tests for the user class (email and username related mostly)

https://gerrit.wikimedia.org/r/561961

Change 561961 merged by jenkins-bot:
[mediawiki/core@master] Add more tests for the user class (email and username related mostly)

https://gerrit.wikimedia.org/r/561961

Change 567465 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add more tests for the user class (factory methods mostly)

https://gerrit.wikimedia.org/r/567465

DannyS712 updated the task description. (Show Details)Mon, Jan 27, 7:01 PM

Change 567465 merged by jenkins-bot:
[mediawiki/core@master] Add more tests for the user class (factory and preferences mostly)

https://gerrit.wikimedia.org/r/567465

DannyS712 updated the task description. (Show Details)Mon, Feb 3, 5:23 PM

Change 569700 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add more tests for the User class

https://gerrit.wikimedia.org/r/569700

DannyS712 updated the task description. (Show Details)Tue, Feb 4, 4:58 AM
DannyS712 updated the task description. (Show Details)Tue, Feb 4, 6:32 PM
DannyS712 updated the task description. (Show Details)Tue, Feb 4, 7:29 PM

Change 569700 merged by jenkins-bot:
[mediawiki/core@master] Add more tests for the User class

https://gerrit.wikimedia.org/r/569700

DannyS712 updated the task description. (Show Details)Thu, Feb 6, 8:04 PM

Change 570707 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add more tests for the User class

https://gerrit.wikimedia.org/r/570707

DannyS712 updated the task description. (Show Details)Tue, Feb 11, 1:07 AM

Change 570707 merged by jenkins-bot:
[mediawiki/core@master] Add more tests for the User class

https://gerrit.wikimedia.org/r/570707

DannyS712 updated the task description. (Show Details)Tue, Feb 11, 6:23 PM
DannyS712 updated the task description. (Show Details)Thu, Feb 13, 3:20 AM

Change 571855 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add more tests for the user class

https://gerrit.wikimedia.org/r/571855

Change 571855 merged by jenkins-bot:
[mediawiki/core@master] Add more tests for the user class

https://gerrit.wikimedia.org/r/571855

DannyS712 updated the task description. (Show Details)Tue, Feb 18, 8:40 PM
DannyS712 updated the task description. (Show Details)Tue, Feb 18, 8:47 PM
DannyS712 updated the task description. (Show Details)Wed, Feb 19, 9:22 AM