Conventionally, public constants are accessed via their declaring
class, except for self:: which is an acceptable shortcut.
Change-Id: If05eab72140267e6ef54736710d751d7f24a7860
UserEditTracker now returns null for anonymous users
instead of throwing an exception.
Added new UserEditTracker::setCachedUserEditCount()
method (internal) to handle the user_editcount field
in User::loadFromRow()'s row. This now means that
the creation of one User object can set the cached
value for any other object for the same underlying user
- the alternative (just ignoring the value) would mean
that an extra database read might be needed. This is
only used for users created with a row that includes
the user id - we silently discard the value if
the row doesn't have a user id (or the user id is 0)
to avoid issues with UserEditTracker trying to fetch
the user id and potentially triggering another load.
A follow-up will simplify the UserEditCountUpdate class
to remove storing full UserIdentity objects now that
only the id is needed.
Follow-up: Ibf1482bcbcbf4d56fc06531bb3e17e2a6e3e2e6f
Change-Id: Ie3fb4887d9f2d96b32598865030351bf3bf20ce5
- UserEditCountUpdate: accept UserIdentity instead of User
- Move User::incEditCount() to UserEditTracker
Change-Id: Ibf1482bcbcbf4d56fc06531bb3e17e2a6e3e2e6f
As previously discussed, the database should usually not be mocked. I'm
changing many of these queries for the next stage of the actor
migration, and just copying my own query from the code to the test file
does not give me any confidence that the query I'm writing is correct.
The unit test was simply ensuring that the implementation of the class
doesn't change, it wasn't verifying correct operation.
Change-Id: Id3ee02fd547d0a7b5b7f35866ee317e8b09e6c18