Remove $actor field from UsererIdentityValue
Code that needs to store an actor ID in the database to represent a UserIdentity, or needs to construct a UserIdentity based on an actor ID loaded from the database, should use the ActorNormalization service. Note: The getActorId() method is removed from the UserIdentity interface, but all concrete classes continue to support it for now. UsererIdentityValue::getActorId() is hard deprecated and should be removed in 1.37. It always returns 0. User::getActorId() is not deprecated at this point. Bug: T274179 Depends-On: Id2b3ddf6a2a7cdf90f8936a69148d2cce6fde237 Change-Id: I9925906d11e47efaec3c1f48d5cb3f9896a982c1
This commit is contained in:
parent
06b47a82ce
commit
fed7f0b179
50 changed files with 355 additions and 397 deletions
|
|
@ -705,6 +705,9 @@ because of Phabricator reports.
|
|||
* UserIdentity::getActorId() is deprecated. The actor ID should not be exposed
|
||||
to application logic. Storage layer code should use the ActorNormalization
|
||||
service for normalizing and denormalizing user names.
|
||||
* Constructing a UserIdentityValue with an actor ID as the third parameter is
|
||||
deprecated. The parameter should be omitted. Storage layer code should use
|
||||
the ActorNormalization service for normalizing and denormalizing user names.
|
||||
* Command::cgroup() is deprecated and no longer functional. $wgShellCgroup is
|
||||
now implemented as an Executor option.
|
||||
* Command::restrict() is deprecated. Instead use the new separate accessors.
|
||||
|
|
|
|||
|
|
@ -2408,7 +2408,6 @@ class RevisionStore
|
|||
$user = new UserIdentityValue(
|
||||
$userID === null ? 0 : $userID,
|
||||
$fields['user_text'],
|
||||
$fields['actor'] ?? 0,
|
||||
$this->wikiId
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,8 +146,7 @@ class DatabaseBlock extends AbstractBlock {
|
|||
if ( !$foreignBlocker ) {
|
||||
// An actor for an interwiki user might not exist on this wiki,
|
||||
// so it's ok to create one. Interwiki actors are still local actors.
|
||||
$foreignBlocker = new UserIdentityValue(
|
||||
0, $options['byText'], 0, UserIdentity::LOCAL );
|
||||
$foreignBlocker = new UserIdentityValue( 0, $options['byText'], UserIdentity::LOCAL );
|
||||
}
|
||||
$this->setBlocker( $foreignBlocker );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -793,8 +793,7 @@ class ChangesList extends ContextSource {
|
|||
$revRecord->setVisibility( (int)$rc->mAttribs['rc_deleted'] );
|
||||
$user = new UserIdentityValue(
|
||||
(int)$rc->mAttribs['rc_user'],
|
||||
$rc->mAttribs['rc_user_text'],
|
||||
(int)( $rc->mAttribs['rc_actor'] ?? 0 )
|
||||
$rc->mAttribs['rc_user_text']
|
||||
);
|
||||
$revRecord->setUser( $user );
|
||||
|
||||
|
|
|
|||
|
|
@ -416,8 +416,7 @@ class SpecialNewpages extends IncludableSpecialPage {
|
|||
|
||||
$user = new UserIdentityValue(
|
||||
(int)$result->rc_user,
|
||||
$result->rc_user_text,
|
||||
(int)$result->rc_actor
|
||||
$result->rc_user_text
|
||||
);
|
||||
$revRecord->setUser( $user );
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class ActorStore implements UserIdentityLookup, ActorNormalization {
|
|||
}
|
||||
}
|
||||
|
||||
$actor = new UserIdentityValue( $userId, $row->actor_name, $actorId, $this->wikiId );
|
||||
$actor = new UserIdentityValue( $userId, $row->actor_name, $this->wikiId );
|
||||
$this->addUserIdentityToCache( $actorId, $actor );
|
||||
return $actor;
|
||||
}
|
||||
|
|
@ -182,7 +182,6 @@ class ActorStore implements UserIdentityLookup, ActorNormalization {
|
|||
$actor = new UserIdentityValue(
|
||||
$userId,
|
||||
$name,
|
||||
$actorId,
|
||||
$this->wikiId
|
||||
);
|
||||
|
||||
|
|
@ -314,9 +313,7 @@ class ActorStore implements UserIdentityLookup, ActorNormalization {
|
|||
* @param int $id
|
||||
*/
|
||||
private function attachActorId( UserIdentity $user, int $id ) {
|
||||
if ( $user instanceof UserIdentityValue ) {
|
||||
$user->setActorId( $id );
|
||||
} elseif ( $user instanceof User ) {
|
||||
if ( $user instanceof User ) {
|
||||
$user->setActorId( $id );
|
||||
}
|
||||
}
|
||||
|
|
@ -329,9 +326,7 @@ class ActorStore implements UserIdentityLookup, ActorNormalization {
|
|||
* @param UserIdentity $user
|
||||
*/
|
||||
private function detachActorId( UserIdentity $user ) {
|
||||
if ( $user instanceof UserIdentityValue ) {
|
||||
$user->setActorId( 0 );
|
||||
} elseif ( $user instanceof User ) {
|
||||
if ( $user instanceof User ) {
|
||||
$user->setActorId( 0 );
|
||||
}
|
||||
}
|
||||
|
|
@ -363,8 +358,9 @@ class ActorStore implements UserIdentityLookup, ActorNormalization {
|
|||
|
||||
$id = $this->findActorIdInternal( $name, $db );
|
||||
|
||||
if ( $id ) {
|
||||
$this->attachActorId( $user, $id );
|
||||
// Set the actor ID in the User object. To be removed, see T274148.
|
||||
if ( $id && $user instanceof User ) {
|
||||
$user->setActorId( $id );
|
||||
}
|
||||
|
||||
return $id;
|
||||
|
|
@ -520,7 +516,10 @@ class ActorStore implements UserIdentityLookup, ActorNormalization {
|
|||
}
|
||||
}
|
||||
|
||||
$this->attachActorId( $user, $actorId );
|
||||
// Set the actor ID in the User object. To be removed, see T274148.
|
||||
if ( $user instanceof User ) {
|
||||
$user->setActorId( $actorId );
|
||||
}
|
||||
|
||||
// Cache row we've just created
|
||||
$cachedUserIdentity = $this->newActorFromRowFields( $userId, $userName, $actorId );
|
||||
|
|
@ -599,7 +598,7 @@ class ActorStore implements UserIdentityLookup, ActorNormalization {
|
|||
if ( $actor ) {
|
||||
return $actor;
|
||||
}
|
||||
$actor = new UserIdentityValue( 0, self::UNKNOWN_USER_NAME, 0, $this->wikiId );
|
||||
$actor = new UserIdentityValue( 0, self::UNKNOWN_USER_NAME, $this->wikiId );
|
||||
|
||||
[ $db, ] = $this->getDBConnectionRefForQueryFlags( self::READ_LATEST );
|
||||
$this->acquireActorId( $actor, $db );
|
||||
|
|
|
|||
|
|
@ -2153,20 +2153,22 @@ class User implements Authority, IDBAccessObject, UserIdentity, UserEmailContact
|
|||
/**
|
||||
* Get the user's actor ID.
|
||||
* @since 1.31
|
||||
* @note This method is deprecated in the UserIdentity interface since 1.36,
|
||||
* @note This method was removed from the UserIdentity interface in 1.36,
|
||||
* but remains supported in the User class for now.
|
||||
* New code should use ActorNormalization::findActorId() or
|
||||
* ActorNormalization::acquireActorId() instead.
|
||||
* @param IDatabase|string|false $dbwOrWikiId Assign a new actor ID, using this DB handle,
|
||||
* if none exists; wiki ID, if provided, must be self::LOCAL; Usage with IDatabase is
|
||||
* deprecated since 1.36
|
||||
* @param IDatabase|string|false $dbwOrWikiId Deprecated since 1.36.
|
||||
* If a database connection is passed, a new actor ID is assigned if needed.
|
||||
* ActorNormalization::acquireActorId() should be used for that purpose instead.
|
||||
* @return int The actor's ID, or 0 if no actor ID exists and $dbw was null
|
||||
* @throws PreconditionException if $dbwOrWikiId is a string and does not match the local wiki
|
||||
*/
|
||||
public function getActorId( $dbwOrWikiId = self::LOCAL ) : int {
|
||||
if ( $dbwOrWikiId instanceof IDatabase ) {
|
||||
wfDeprecatedMsg( 'Passing parameter of type IDatabase', '1.36' );
|
||||
} else {
|
||||
if ( $dbwOrWikiId ) {
|
||||
wfDeprecatedMsg( 'Passing a parameter to getActorId() is deprecated', '1.36' );
|
||||
}
|
||||
|
||||
if ( is_string( $dbwOrWikiId ) ) {
|
||||
$this->assertWiki( $dbwOrWikiId );
|
||||
}
|
||||
|
||||
|
|
@ -2191,9 +2193,8 @@ class User implements Authority, IDBAccessObject, UserIdentity, UserEmailContact
|
|||
|
||||
/**
|
||||
* Sets the actor id.
|
||||
*
|
||||
* This method is deprecated upon introduction. It only exists for transition to ActorStore,
|
||||
* and will be removed shortly - T274148
|
||||
* For use by ActorStore only.
|
||||
* Should be removed once callers of getActorId() have been migrated to using ActorNormalization.
|
||||
*
|
||||
* @internal
|
||||
* @deprecated since 1.36
|
||||
|
|
|
|||
|
|
@ -54,23 +54,6 @@ interface UserIdentity extends WikiAwareEntity {
|
|||
*/
|
||||
public function getName() : string;
|
||||
|
||||
/**
|
||||
* @since 1.31
|
||||
*
|
||||
* @param string|false $wikiId The wiki ID expected by the caller.
|
||||
* Use self::LOCAL for the local wiki.
|
||||
*
|
||||
* @deprecated since 1.36, use ActorNormalization::findActorId() instead.
|
||||
*
|
||||
* @return int The user's actor ID. May be 0 if no actor ID is set.
|
||||
*
|
||||
* @note This will trigger a deprecation warning when $wikiId mismatches $this->getWikiId().
|
||||
* In the future, it will throw PreconditionException.
|
||||
*/
|
||||
public function getActorId( $wikiId = self::LOCAL ) : int;
|
||||
|
||||
// TODO: we may want to (optionally?) provide a global ID, see CentralIdLookup.
|
||||
|
||||
/**
|
||||
* @since 1.32
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ namespace MediaWiki\User;
|
|||
|
||||
use MediaWiki\DAO\WikiAwareEntityTrait;
|
||||
use Wikimedia\Assert\Assert;
|
||||
use Wikimedia\Assert\PostconditionException;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
|
||||
/**
|
||||
* Value object representing a user's identity.
|
||||
|
|
@ -47,31 +45,41 @@ class UserIdentityValue implements UserIdentity {
|
|||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $actor;
|
||||
|
||||
/** @var bool|string */
|
||||
private $wikiId;
|
||||
|
||||
/**
|
||||
* @stable to call
|
||||
*
|
||||
* @note Signature in 1.35 was: ( $id, $name, $actor ). This is still supported for
|
||||
* backwards compatibility until 1.37. $actor is ignored.
|
||||
*
|
||||
* @param int $id user ID
|
||||
* @param string $name user name
|
||||
* @param int $actor actor ID
|
||||
* @param string|false $wikiId wiki ID or self::LOCAL for the local wiki
|
||||
*/
|
||||
public function __construct( $id, $name, $actor = 0, $wikiId = self::LOCAL ) {
|
||||
public function __construct( $id, $name, $wikiId = self::LOCAL ) {
|
||||
if ( is_int( $wikiId ) ) {
|
||||
// Handle old signature: ( $id, $name, $actor, $wikiId )
|
||||
$args = func_get_args();
|
||||
$actor = $args[2];
|
||||
$wikiId = $args[3] ?? self::LOCAL;
|
||||
|
||||
if ( $actor > 0 || $wikiId !== self::LOCAL ) {
|
||||
// NOTE: For now, we only trigger a deprecation warning if $actor is not 0,
|
||||
// or a $wikiId is given.
|
||||
// A lot of tests construct UserIdentityValue with $actor = 0.
|
||||
// TODO: Trigger a deprecation warning even if $actor is 0
|
||||
wfDeprecatedMsg( 'Old constructor signature: $actor is no longer supported', '1.36' );
|
||||
}
|
||||
}
|
||||
|
||||
Assert::parameterType( 'integer', $id, '$id' );
|
||||
Assert::parameterType( 'string', $name, '$name' );
|
||||
Assert::parameterType( 'integer', $actor, '$actor' );
|
||||
$this->assertWikiIdParam( $wikiId );
|
||||
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
$this->actor = $actor;
|
||||
$this->wikiId = $wikiId;
|
||||
}
|
||||
|
||||
|
|
@ -107,34 +115,15 @@ class UserIdentityValue implements UserIdentity {
|
|||
}
|
||||
|
||||
/**
|
||||
* The numerical actor ID provided to the constructor or 0 if no actor ID has been assigned.
|
||||
*
|
||||
* @deprecated since 1.36, use ActorNormalization::acquireActorId instead.
|
||||
*
|
||||
* @param string|false $wikiId The wiki ID expected by the caller.
|
||||
* Omit if expecting the local wiki. Since 1.36.
|
||||
* @param string|false $wikiId
|
||||
*
|
||||
* @return int The user's actor ID. May be 0 if no actor ID has been assigned.
|
||||
* @return int always 0.
|
||||
*/
|
||||
public function getActorId( $wikiId = self::LOCAL ) : int {
|
||||
// need to check if $wikiId is an instance of IDatabase, since for legacy reasons,
|
||||
// some callers call this function on a UserIdentity passing an IDatabase
|
||||
if ( $wikiId instanceof IDatabase ) {
|
||||
wfDeprecatedMsg( 'Passing parameter of type IDatabase', '1.36' );
|
||||
if ( $this->actor === 0 ) {
|
||||
// Passing an IDatabase was never actually allowed on this class.
|
||||
// We just support it to prevent hard breakage in places where callers where
|
||||
// assuming they got a User, when they actually just have a UserIdentity.
|
||||
// However, the caller is expecting to get back a valid actorId. Not getting one
|
||||
// may cause data corruption.
|
||||
throw new PostconditionException(
|
||||
'Caller expects non-zero actor ID.'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->deprecateInvalidCrossWiki( $wikiId, '1.36' );
|
||||
}
|
||||
return $this->actor;
|
||||
wfDeprecated( __METHOD__, '1.36' );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -163,17 +152,4 @@ class UserIdentityValue implements UserIdentity {
|
|||
return $this->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the actor id.
|
||||
*
|
||||
* This method is deprecated upon introduction. It only exists for transition to ActorStore,
|
||||
* and will be removed shortly - T274148
|
||||
*
|
||||
* @internal
|
||||
* @deprecated since 1.36
|
||||
* @param int $actorId
|
||||
*/
|
||||
public function setActorId( int $actorId ) {
|
||||
$this->actor = $actorId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ class UserRightsProxy {
|
|||
// After all the relevant UserGroupMemberships methods are ported into UserGroupManager,
|
||||
// the usages of this class will be changed into usages of the UserGroupManager,
|
||||
// thus the need of this class and the need of this artificial UserIdentityValue will parish.
|
||||
$user = new UserIdentityValue( $this->getId(), $this->getName(), 0 );
|
||||
$user = new UserIdentityValue( $this->getId(), $this->getName() );
|
||||
return $this->userGroupManager->getUserGroupMemberships( $user, IDBAccessObject::READ_LATEST );
|
||||
}
|
||||
|
||||
|
|
@ -234,7 +234,7 @@ class UserRightsProxy {
|
|||
return $this->userGroupManager->addUserToGroup(
|
||||
// TODO: Artificial UserIdentity just for passing the id and name.
|
||||
// see comment in getGroupMemberships.
|
||||
new UserIdentityValue( $this->getId(), $this->getName(), 0 ),
|
||||
new UserIdentityValue( $this->getId(), $this->getName() ),
|
||||
$group,
|
||||
$expiry
|
||||
);
|
||||
|
|
@ -250,7 +250,7 @@ class UserRightsProxy {
|
|||
return $this->userGroupManager->removeUserFromGroup(
|
||||
// TODO: Artificial UserIdentity just for passing the id and name.
|
||||
// see comment in getGroupMemberships.
|
||||
new UserIdentityValue( $this->getId(), $this->getName(), 0 ),
|
||||
new UserIdentityValue( $this->getId(), $this->getName() ),
|
||||
$group
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -338,15 +338,15 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
|
|||
}
|
||||
|
||||
public function provideGetWhere() {
|
||||
$genericUser = new UserIdentityValue( 1, 'User1', 11 );
|
||||
$genericUser = new UserIdentityValue( 1, 'User1' );
|
||||
$complicatedUsers = [
|
||||
new UserIdentityValue( 1, 'User1', 11 ),
|
||||
new UserIdentityValue( 2, 'User2', 12 ),
|
||||
new UserIdentityValue( 3, 'User3', 0 ),
|
||||
new UserIdentityValue( 0, '192.168.12.34', 34 ),
|
||||
new UserIdentityValue( 0, '192.168.12.35', 0 ),
|
||||
new UserIdentityValue( 1, 'User1' ),
|
||||
new UserIdentityValue( 2, 'User2' ),
|
||||
new UserIdentityValue( 3, 'User3' ),
|
||||
new UserIdentityValue( 0, '192.168.12.34' ),
|
||||
new UserIdentityValue( 0, '192.168.12.35' ),
|
||||
// test handling of non-normalized IPv6 IP
|
||||
new UserIdentityValue( 0, '2600:1004:b14a:5ddd:3ebe:bba4:bfba:f37e', 0 ),
|
||||
new UserIdentityValue( 0, '2600:1004:b14a:5ddd:3ebe:bba4:bfba:f37e' ),
|
||||
];
|
||||
|
||||
return [
|
||||
|
|
@ -566,9 +566,7 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
|
|||
*/
|
||||
public function testInsertRoundTrip( $table, $key, $pk, $usesTemp ) {
|
||||
$u = $this->getTestUser()->getUser();
|
||||
$actorNormalization = $this->getServiceContainer()->getActorNormalization();
|
||||
$actorId = $actorNormalization->acquireActorId( $u, $this->db );
|
||||
$user = new UserIdentityValue( $u->getId(), $u->getName(), $actorId );
|
||||
$user = new UserIdentityValue( $u->getId(), $u->getName() );
|
||||
|
||||
$stageNames = [
|
||||
SCHEMA_COMPAT_OLD => 'old',
|
||||
|
|
@ -622,7 +620,7 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
|
|||
$this->assertArrayNotHasKey( $nameKey, $fields, "old field, stage={$stageNames[$writeStage]}" );
|
||||
}
|
||||
if ( ( $writeStage & SCHEMA_COMPAT_WRITE_NEW ) && !$usesTemp ) {
|
||||
$this->assertSame( $user->getActorId(), $fields[$actorKey],
|
||||
$this->assertArrayHasKey( $actorKey, $fields,
|
||||
"new field, stage={$stageNames[$writeStage]}" );
|
||||
} else {
|
||||
$this->assertArrayNotHasKey( $actorKey, $fields,
|
||||
|
|
@ -652,11 +650,6 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
|
|||
"w={$stageNames[$writeStage]}, r={$stageNames[$readStage]}, id" );
|
||||
$this->assertSame( $user->getName(), $row->$nameKey,
|
||||
"w={$stageNames[$writeStage]}, r={$stageNames[$readStage]}, name" );
|
||||
$this->assertSame(
|
||||
( $readStage & SCHEMA_COMPAT_READ_OLD ) ? 0 : $user->getActorId(),
|
||||
(int)$row->$actorKey,
|
||||
"w={$stageNames[$writeStage]}, r={$stageNames[$readStage]}, actor"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -749,7 +742,7 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
|
|||
*/
|
||||
public function testInsertUserIdentity( $stage ) {
|
||||
$user = $this->getMutableTestUser()->getUser();
|
||||
$userIdentity = new UserIdentityValue( $user->getId(), $user->getName(), 0 );
|
||||
$userIdentity = new UserIdentityValue( $user->getId(), $user->getName() );
|
||||
|
||||
$m = $this->getMigration( $stage );
|
||||
list( $fields, $callback ) =
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class MWTimestampTest extends MediaWikiLangTestCase {
|
|||
'date' => $dateFormat
|
||||
] );
|
||||
|
||||
$user = new UserIdentityValue( 13, 'Pamela', 0 );
|
||||
$user = new UserIdentityValue( 13, 'Pamela' );
|
||||
|
||||
$tsTime = new MWTimestamp( $tsTime );
|
||||
$currentTime = new MWTimestamp( $currentTime );
|
||||
|
|
@ -187,7 +187,7 @@ class MWTimestampTest extends MediaWikiLangTestCase {
|
|||
'date' => $dateFormat
|
||||
] );
|
||||
|
||||
$user = new UserIdentityValue( 13, 'Pamela', 0 );
|
||||
$user = new UserIdentityValue( 13, 'Pamela' );
|
||||
|
||||
$tsTime = new MWTimestamp( $tsTime );
|
||||
$currentTime = new MWTimestamp( $currentTime );
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class MWBasicRequestAuthorizerTest extends MediaWikiIntegrationTestCase {
|
|||
$objectFactory = new ObjectFactory(
|
||||
$this->getMockForAbstractClass( ContainerInterface::class )
|
||||
);
|
||||
$authority = new SimpleAuthority( new UserIdentityValue( 0, 'Test user', 0 ), $userRights );
|
||||
$authority = new SimpleAuthority( new UserIdentityValue( 0, 'Test user' ), $userRights );
|
||||
|
||||
global $IP;
|
||||
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ class ContributionsLookupTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
public function testPermissionChecksAreApplied() {
|
||||
$editingUser = self::$testUser;
|
||||
$dummyUser = new UserIdentityValue( 0, 'test', 0 );
|
||||
$dummyUser = new UserIdentityValue( 0, 'test' );
|
||||
|
||||
$contributionsLookup = $this->getContributionsLookup();
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class RenderedRevisionTest extends MediaWikiIntegrationTestCase {
|
|||
$visibility = 0,
|
||||
array $content = null
|
||||
) {
|
||||
$frank = new UserIdentityValue( 9, 'Frank', 0 );
|
||||
$frank = new UserIdentityValue( 9, 'Frank' );
|
||||
|
||||
if ( !$content ) {
|
||||
$text = "";
|
||||
|
|
@ -543,7 +543,7 @@ class RenderedRevisionTest extends MediaWikiIntegrationTestCase {
|
|||
$savedRev->setContent( SlotRecord::MAIN, new WikitextContent( $text ) );
|
||||
$savedRev->setContent( 'aux', new WikitextContent( '[[Goats]]' ) );
|
||||
$savedRev->setId( 23 ); // saved, new
|
||||
$savedRev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$savedRev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$savedRev->setTimestamp( '20180101000003' );
|
||||
|
||||
$rr->updateRevision( $savedRev );
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ use Wikimedia\Assert\PreconditionException;
|
|||
class RevisionArchiveRecordTest extends MediaWikiIntegrationTestCase {
|
||||
|
||||
public function provideConstructor() {
|
||||
$user = new UserIdentityValue( 11, 'Tester', 0 );
|
||||
$user = new UserIdentityValue( 11, 'Tester' );
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
|
||||
|
||||
$main = SlotRecord::newUnsaved( SlotRecord::MAIN, new TextContent( 'Lorem Ipsum' ) );
|
||||
|
|
@ -189,7 +189,7 @@ class RevisionArchiveRecordTest extends MediaWikiIntegrationTestCase {
|
|||
$title = Title::newFromText( 'Dummy' );
|
||||
$title->resetArticleID( 17 );
|
||||
|
||||
$user = new UserIdentityValue( 11, 'Tester', 0 );
|
||||
$user = new UserIdentityValue( 11, 'Tester' );
|
||||
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
$title = $this->getMockTitle( 7, 21 );
|
||||
|
||||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setId( 21 ); // current!
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setId( 21 ); // current!
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setId( 21 ); // current!
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setId( 11 ); // old!
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setId( 11 ); // old!
|
||||
$rev->setVisibility( RevisionRecord::DELETED_TEXT ); // suppressed!
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
@ -320,7 +320,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setId( 11 ); // old!
|
||||
$rev->setVisibility( RevisionRecord::DELETED_TEXT ); // suppressed!
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setId( 11 ); // old!
|
||||
$rev->setVisibility( RevisionRecord::DELETED_TEXT ); // suppressed!
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
@ -406,7 +406,7 @@ class RevisionRendererTest extends MediaWikiIntegrationTestCase {
|
|||
$title = $this->getMockTitle( 7, 21 );
|
||||
|
||||
$rev = new MutableRevisionRecord( $title );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank', 0 ) );
|
||||
$rev->setUser( new UserIdentityValue( 9, 'Frank' ) );
|
||||
$rev->setTimestamp( '20180101000003' );
|
||||
$rev->setComment( CommentStoreComment::newUnsavedComment( '' ) );
|
||||
|
||||
|
|
|
|||
|
|
@ -1006,12 +1006,14 @@ abstract class RevisionStoreDbTestBase extends MediaWikiIntegrationTestCase {
|
|||
);
|
||||
|
||||
$revUser = $revRecord->getUser();
|
||||
$actorId = $this->getServiceContainer()
|
||||
->getActorNormalization()->findActorId( $revUser, $this->db );
|
||||
|
||||
$fields = [
|
||||
'rev_id' => (string)$revRecord->getId(),
|
||||
'rev_page' => (string)$revRecord->getPageId(),
|
||||
'rev_timestamp' => $this->db->timestamp( $revRecord->getTimestamp() ),
|
||||
'rev_actor' => $revUser ? $revUser->getActorId() : null,
|
||||
'rev_actor' => $actorId,
|
||||
'rev_user_text' => $revUser ? $revUser->getName() : '',
|
||||
'rev_user' => (string)( $revUser ? $revUser->getId() : 0 ) ?: null,
|
||||
'rev_minor_edit' => $revRecord->isMinor() ? '1' : '0',
|
||||
|
|
@ -1818,7 +1820,7 @@ abstract class RevisionStoreDbTestBase extends MediaWikiIntegrationTestCase {
|
|||
$rev = new MutableRevisionRecord( $title );
|
||||
yield [ $rev ];
|
||||
|
||||
$user = new UserIdentityValue( 7, 'Frank', 0 );
|
||||
$user = new UserIdentityValue( 7, 'Frank' );
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Test' );
|
||||
$row = (object)[
|
||||
'ar_id' => 3,
|
||||
|
|
@ -3113,7 +3115,7 @@ abstract class RevisionStoreDbTestBase extends MediaWikiIntegrationTestCase {
|
|||
return $services->getUserFactory()->newAnonymous( $ip );
|
||||
} ];
|
||||
yield 'User identity, anon' => [ '127.1.1.1', static function ( MediaWikiServices $services, string $ip ) {
|
||||
return new UserIdentityValue( 0, $ip, 0 );
|
||||
return new UserIdentityValue( 0, $ip );
|
||||
} ];
|
||||
}
|
||||
|
||||
|
|
@ -3122,7 +3124,10 @@ abstract class RevisionStoreDbTestBase extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testInsertRevisionByAnonAssignsNewActor( string $ip, callable $userInitCallback ) {
|
||||
$user = $userInitCallback( $this->getServiceContainer(), $ip );
|
||||
$this->assertSame( 0, $user->getActorId(), 'Sanity, new actor has no actor_id' );
|
||||
|
||||
$actorNormalization = $this->getServiceContainer()->getActorNormalization();
|
||||
$actorId = $actorNormalization->findActorId( $user, $this->db );
|
||||
$this->assertNull( $actorId, 'Sanity, new actor has no actor_id' );
|
||||
|
||||
$page = $this->getTestPage();
|
||||
$rev = new MutableRevisionRecord( $page->getTitle() );
|
||||
|
|
@ -3134,6 +3139,8 @@ abstract class RevisionStoreDbTestBase extends MediaWikiIntegrationTestCase {
|
|||
|
||||
$return = $this->getServiceContainer()->getRevisionStore()->insertRevisionOn( $rev, $this->db );
|
||||
$this->assertSame( $ip, $return->getUser()->getName() );
|
||||
$this->assertNotSame( 0, $return->getUser()->getActorId() );
|
||||
|
||||
$actorId = $actorNormalization->findActorId( $user, $this->db );
|
||||
$this->assertNotNull( $actorId );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ use Wikimedia\Timestamp\TimestampException;
|
|||
class RevisionStoreRecordTest extends MediaWikiIntegrationTestCase {
|
||||
|
||||
public function provideConstructor() {
|
||||
$user = new UserIdentityValue( 11, 'Tester', 0 );
|
||||
$user = new UserIdentityValue( 11, 'Tester' );
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
|
||||
|
||||
$main = SlotRecord::newUnsaved( SlotRecord::MAIN, new TextContent( 'Lorem Ipsum' ) );
|
||||
|
|
@ -216,7 +216,7 @@ class RevisionStoreRecordTest extends MediaWikiIntegrationTestCase {
|
|||
$title = Title::newFromText( 'Dummy' );
|
||||
$title->resetArticleID( 17 );
|
||||
|
||||
$user = new UserIdentityValue( 11, 'Tester', 0 );
|
||||
$user = new UserIdentityValue( 11, 'Tester' );
|
||||
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
|
||||
|
||||
|
|
|
|||
|
|
@ -1435,7 +1435,7 @@ class TitleTest extends MediaWikiIntegrationTestCase {
|
|||
];
|
||||
yield '(makeTitle vs UserIdentityValue) name text' => [
|
||||
Title::makeTitle( NS_MAIN, 'Foo' ),
|
||||
new UserIdentityValue( 7, 'Foo', 8 ),
|
||||
new UserIdentityValue( 7, 'Foo' ),
|
||||
false
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class RecentChangeTest extends MediaWikiIntegrationTestCase {
|
|||
$this->target = Title::newFromText( 'TestTarget' );
|
||||
|
||||
$user = $this->getTestUser()->getUser();
|
||||
$this->user = new UserIdentityValue( $user->getId(), $user->getName(), $user->getActorId() );
|
||||
$this->user = new UserIdentityValue( $user->getId(), $user->getName() );
|
||||
|
||||
$this->user_comment = '<User comment about action>';
|
||||
$this->context = RequestContext::newExtraneousContext( $this->title );
|
||||
|
|
@ -114,7 +114,7 @@ class RecentChangeTest extends MediaWikiIntegrationTestCase {
|
|||
$actualAttribs = array_intersect_key( $rc->mAttribs, $attribs );
|
||||
$this->assertArrayEquals( $attribs, $actualAttribs, false, true );
|
||||
|
||||
$user = new UserIdentityValue( $attribs['rc_user'] ?? 0, $attribs['rc_user_text'], 0 );
|
||||
$user = new UserIdentityValue( $attribs['rc_user'] ?? 0, $attribs['rc_user_text'] );
|
||||
$this->assertTrue( $user->equals( $rc->getPerformerIdentity() ) );
|
||||
$this->assertTrue( $user->equals( $rc->getPerformer() ) );
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class RequestContextTest extends MediaWikiIntegrationTestCase {
|
|||
$this->assertTrue( $user->equals( $context->getAuthority()->getUser() ) );
|
||||
$this->assertTrue( $user->equals( $context->getUser() ) );
|
||||
|
||||
$authorityActor = new UserIdentityValue( 42, 'Test', 24 );
|
||||
$authorityActor = new UserIdentityValue( 42, 'Test' );
|
||||
$authority = new UltimateAuthority( $authorityActor );
|
||||
|
||||
$context->setAuthority( $authority );
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ class LogFormatterTest extends MediaWikiLangTestCase {
|
|||
*/
|
||||
public function testGetPerformerElement() {
|
||||
$entry = $this->newLogEntry( 'param', [] );
|
||||
$entry->setPerformer( new UserIdentityValue( 1328435, 'Test', 0 ) );
|
||||
$entry->setPerformer( new UserIdentityValue( 1328435, 'Test' ) );
|
||||
|
||||
$formatter = LogFormatter::newFromEntry( $entry );
|
||||
$formatter->setContext( $this->context );
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ class PageArchiveTest extends MediaWikiIntegrationTestCase {
|
|||
'ar_user' => null,
|
||||
'ar_user_text' => $this->ipEditor,
|
||||
'ar_actor' => (string)$this->getServiceContainer()->getActorNormalization()
|
||||
->acquireActorId( new UserIdentityValue( 0, $this->ipEditor, 0 ), $this->db ),
|
||||
->acquireActorId( new UserIdentityValue( 0, $this->ipEditor ), $this->db ),
|
||||
'ar_len' => '11',
|
||||
'ar_deleted' => '0',
|
||||
'ar_rev_id' => strval( $this->ipRev->getId() ),
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ class ParserMethodsTest extends MediaWikiLangTestCase {
|
|||
|
||||
$oldRevision = new MutableRevisionRecord( $title );
|
||||
$oldRevision->setId( 100 );
|
||||
$oldRevision->setUser( new UserIdentityValue( 7, 'FauxAuthor', 0 ) );
|
||||
$oldRevision->setUser( new UserIdentityValue( 7, 'FauxAuthor' ) );
|
||||
$oldRevision->setTimestamp( '20141111111111' );
|
||||
$oldRevision->setContent( SlotRecord::MAIN, new WikitextContent( 'FAUX' ) );
|
||||
|
||||
|
|
@ -265,7 +265,7 @@ class ParserMethodsTest extends MediaWikiLangTestCase {
|
|||
. 'user-subst:{{subst:REVISIONUSER}};time-subst:{{subst:REVISIONTIMESTAMP}};';
|
||||
|
||||
$newRevision = new MutableRevisionRecord( $title );
|
||||
$newRevision->setUser( new UserIdentityValue( 9, 'NewAuthor', 0 ) );
|
||||
$newRevision->setUser( new UserIdentityValue( 9, 'NewAuthor' ) );
|
||||
$newRevision->setTimestamp( '20180808000000' );
|
||||
$newRevision->setContent( SlotRecord::MAIN, new WikitextContent( 'NEW' ) );
|
||||
|
||||
|
|
@ -300,7 +300,7 @@ class ParserMethodsTest extends MediaWikiLangTestCase {
|
|||
. "<noinclude>#{{:ParserRevisionAccessTest}}#</noinclude>";
|
||||
|
||||
$newRevision = new MutableRevisionRecord( $title );
|
||||
$newRevision->setUser( new UserIdentityValue( 9, 'NewAuthor', 0 ) );
|
||||
$newRevision->setUser( new UserIdentityValue( 9, 'NewAuthor' ) );
|
||||
$newRevision->setTimestamp( '20180808000000' );
|
||||
$newRevision->setContent( SlotRecord::MAIN, new WikitextContent( $text ) );
|
||||
|
||||
|
|
@ -331,13 +331,13 @@ class ParserMethodsTest extends MediaWikiLangTestCase {
|
|||
|
||||
$oldRevision = new MutableRevisionRecord( $title );
|
||||
$oldRevision->setId( 100 );
|
||||
$oldRevision->setUser( new UserIdentityValue( 7, 'OldAuthor', 0 ) );
|
||||
$oldRevision->setUser( new UserIdentityValue( 7, 'OldAuthor' ) );
|
||||
$oldRevision->setTimestamp( '20140404000000' );
|
||||
$oldRevision->setContent( SlotRecord::MAIN, new WikitextContent( 'OLD' ) );
|
||||
|
||||
$currentRevision = new MutableRevisionRecord( $title );
|
||||
$currentRevision->setId( 200 );
|
||||
$currentRevision->setUser( new UserIdentityValue( 9, 'CurrentAuthor', 0 ) );
|
||||
$currentRevision->setUser( new UserIdentityValue( 9, 'CurrentAuthor' ) );
|
||||
$currentRevision->setTimestamp( '20160606000000' );
|
||||
$currentRevision->setContent( SlotRecord::MAIN, new WikitextContent( 'CURRENT' ) );
|
||||
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testAddUserToGroupAnon() {
|
||||
$manager = $this->getManager();
|
||||
$anon = new UserIdentityValue( 0, 'Anon', 0 );
|
||||
$anon = new UserIdentityValue( 0, 'Anon' );
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
$manager->addUserToGroup( $anon, 'test' );
|
||||
}
|
||||
|
|
@ -341,7 +341,7 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetUserGroupMembershipsForAnon() {
|
||||
$manager = $this->getManager();
|
||||
$anon = new UserIdentityValue( 0, 'Anon', 0 );
|
||||
$anon = new UserIdentityValue( 0, 'Anon' );
|
||||
|
||||
$this->assertEmpty( $manager->getUserGroupMemberships( $anon ) );
|
||||
}
|
||||
|
|
@ -351,7 +351,7 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetUserFormerGroupsForAnon() {
|
||||
$manager = $this->getManager();
|
||||
$anon = new UserIdentityValue( 0, 'Anon', 0 );
|
||||
$anon = new UserIdentityValue( 0, 'Anon' );
|
||||
|
||||
$this->assertEmpty( $manager->getUserFormerGroups( $anon ) );
|
||||
}
|
||||
|
|
@ -440,7 +440,7 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testRemoveUserFromGroupAnon() {
|
||||
$manager = $this->getManager();
|
||||
$anon = new UserIdentityValue( 0, 'Anon', 0 );
|
||||
$anon = new UserIdentityValue( 0, 'Anon' );
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
$manager->removeUserFromGroup( $anon, 'test' );
|
||||
}
|
||||
|
|
@ -995,7 +995,7 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testAddUserToAutopromoteOnceGroupsAnon() {
|
||||
$manager = $this->getManager();
|
||||
$anon = new UserIdentityValue( 0, 'TEST', 0 );
|
||||
$anon = new UserIdentityValue( 0, 'TEST' );
|
||||
$this->assertEmpty( $manager->addUserToAutopromoteOnceGroups( $anon, 'TEST' ) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ abstract class UserOptionsLookupTest extends MediaWikiIntegrationTestCase {
|
|||
protected function getAnon(
|
||||
string $name = 'anon'
|
||||
) : UserIdentity {
|
||||
return new UserIdentityValue( 0, $name, 0 );
|
||||
return new UserIdentityValue( 0, $name );
|
||||
}
|
||||
|
||||
abstract protected function getLookup(
|
||||
|
|
|
|||
|
|
@ -1014,6 +1014,8 @@ class UserTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers User::newFromActorId
|
||||
*/
|
||||
public function testActorId() {
|
||||
$this->filterDeprecated( '/Passing a parameter to getActorId\(\) is deprecated/', '1.36' );
|
||||
|
||||
// Newly-created user has an actor ID
|
||||
$user = User::createNew( 'UserTestActorId1' );
|
||||
$id = $user->getId();
|
||||
|
|
@ -1075,6 +1077,8 @@ class UserTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers User::getActorId
|
||||
*/
|
||||
public function testForeignGetActorId() {
|
||||
$this->filterDeprecated( '/Passing a parameter to getActorId\(\) is deprecated/', '1.36' );
|
||||
|
||||
$user = User::newFromName( 'UserTestActorId1' );
|
||||
$this->expectException( PreconditionException::class );
|
||||
$user->getActorId( 'Foreign Wiki' );
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ use MediaWiki\User\UserIdentityValue;
|
|||
use MediaWiki\User\UserNameUtils;
|
||||
use MediaWiki\User\UserSelectQueryBuilder;
|
||||
use stdClass;
|
||||
use User;
|
||||
use Wikimedia\Assert\PreconditionException;
|
||||
|
||||
/**
|
||||
|
|
@ -25,11 +26,11 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
public function provideGetActorById() {
|
||||
yield 'getActorById, registered' => [
|
||||
42, // $argument
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 24, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'getActorById, anon' => [
|
||||
43, // $argument
|
||||
new UserIdentityValue( 0, self::IP, 43 ), // $expected
|
||||
new UserIdentityValue( 0, self::IP ), // $expected
|
||||
];
|
||||
yield 'getActorById, non-existent' => [
|
||||
4321231, // $argument
|
||||
|
|
@ -65,7 +66,7 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
yield 'getUserIdentityByName, registered' => [
|
||||
'getUserIdentityByName', // $method
|
||||
'TestUser', // $argument
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 24, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'getUserIdentityByName, non-existent' => [
|
||||
'getUserIdentityByName', // $method
|
||||
|
|
@ -75,17 +76,17 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
yield 'getUserIdentityByName, anon' => [
|
||||
'getUserIdentityByName', // $method
|
||||
self::IP, // $argument
|
||||
new UserIdentityValue( 0, self::IP, 43 ), // $expected
|
||||
new UserIdentityValue( 0, self::IP ), // $expected
|
||||
];
|
||||
yield 'getUserIdentityByName, anon, non-canonicalized IP' => [
|
||||
'getUserIdentityByName', // $method
|
||||
strtolower( self::IP ), // $argument
|
||||
new UserIdentityValue( 0, self::IP, 43 ), // $expected
|
||||
new UserIdentityValue( 0, self::IP ), // $expected
|
||||
];
|
||||
yield 'getUserIdentityByUserId, registered' => [
|
||||
'getUserIdentityByUserId', // $method
|
||||
24, // $argument
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 24, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'getUserIdentityByUserId, non-exitent' => [
|
||||
'getUserIdentityByUserId', // $method
|
||||
|
|
@ -120,8 +121,8 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
}
|
||||
|
||||
public function provideUserIdentityValues() {
|
||||
yield [ new UserIdentityValue( 24, 'TestUser', 42 ) ];
|
||||
yield [ new UserIdentityValue( 0, self::IP, 43 ) ];
|
||||
yield [ new UserIdentityValue( 24, 'TestUser' ) ];
|
||||
yield [ new UserIdentityValue( 0, self::IP ) ];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -136,7 +137,6 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
public function testSequentialCacheRetrieval( UserIdentity $expected ) {
|
||||
// ensure UserIdentity is cached
|
||||
$actorId = $this->getStore()->findActorId( $expected, $this->db );
|
||||
$this->assertSame( $expected->getActorId(), $actorId );
|
||||
|
||||
$cachedActorId = $this->getStore()->findActorId( $expected, $this->db );
|
||||
$this->assertSame( $actorId, $cachedActorId );
|
||||
|
|
@ -206,22 +206,22 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
yield 'full row' => [
|
||||
UserIdentity::LOCAL, // $wikiId
|
||||
(object)[ 'actor_id' => 42, 'actor_name' => 'TestUser', 'actor_user' => 24 ], // $row
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 24, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'full row, strings' => [
|
||||
UserIdentity::LOCAL, // $wikiId
|
||||
(object)[ 'actor_id' => '42', 'actor_name' => 'TestUser', 'actor_user' => '24' ], // $row
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 24, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'null user' => [
|
||||
UserIdentity::LOCAL, // $wikiId
|
||||
(object)[ 'actor_id' => '42', 'actor_name' => 'TestUser', 'actor_user' => null ], // $row
|
||||
new UserIdentityValue( 0, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 0, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'zero user' => [
|
||||
UserIdentity::LOCAL, // $wikiId
|
||||
(object)[ 'actor_id' => '42', 'actor_name' => 'TestUser', 'actor_user' => 0 ], // $row
|
||||
new UserIdentityValue( 0, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 0, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'cross-wiki' => [
|
||||
'acmewiki', // $wikiId
|
||||
|
|
@ -266,28 +266,28 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
42, // $actorId
|
||||
'TestUser', // $name
|
||||
24, // $userId
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 24, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'full row, strings' => [
|
||||
UserIdentity::LOCAL, // $wikiId
|
||||
'42', // $actorId
|
||||
'TestUser', // $name
|
||||
'24', // $userId
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 24, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'null user' => [
|
||||
UserIdentity::LOCAL, // $wikiId
|
||||
42, // $actorId
|
||||
'TestUser', // $name
|
||||
null, // $userId
|
||||
new UserIdentityValue( 0, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 0, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'zero user' => [
|
||||
UserIdentity::LOCAL, // $wikiId
|
||||
42, // $actorId
|
||||
'TestUser', // $name
|
||||
0, // $userId
|
||||
new UserIdentityValue( 0, 'TestUser', 42 ), // $expected
|
||||
new UserIdentityValue( 0, 'TestUser' ), // $expected
|
||||
];
|
||||
yield 'cross-wiki' => [
|
||||
'acmewiki', // $wikiId
|
||||
|
|
@ -342,37 +342,37 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
public function provideFindActorId() {
|
||||
yield 'anon, local' => [
|
||||
static function () {
|
||||
return new UserIdentityValue( 0, self::IP, 0 );
|
||||
return new UserIdentityValue( 0, self::IP );
|
||||
}, // $actorCallback
|
||||
43, // $expected
|
||||
];
|
||||
yield 'anon, non-canonical, local' => [
|
||||
static function () {
|
||||
return new UserIdentityValue( 0, strtolower( self::IP ), 0 );
|
||||
return new UserIdentityValue( 0, strtolower( self::IP ) );
|
||||
}, // $actorCallback
|
||||
43, // $expected
|
||||
];
|
||||
yield 'registered, local' => [
|
||||
static function () {
|
||||
return new UserIdentityValue( 24, 'TestUser', 0 );
|
||||
return new UserIdentityValue( 24, 'TestUser' );
|
||||
}, // $actorCallback
|
||||
42, // $expected
|
||||
];
|
||||
yield 'anon, non-existent, local' => [
|
||||
static function () {
|
||||
return new UserIdentityValue( 0, '127.1.2.3', 0 );
|
||||
return new UserIdentityValue( 0, '127.1.2.3' );
|
||||
}, // $actorCallback
|
||||
null, // $expected
|
||||
];
|
||||
yield 'registered, non-existent, local' => [
|
||||
static function () {
|
||||
return new UserIdentityValue( 51, 'DoNotExist', 0 );
|
||||
return new UserIdentityValue( 51, 'DoNotExist' );
|
||||
}, // $actorCallback
|
||||
null, // $expected
|
||||
];
|
||||
yield 'external, local' => [
|
||||
static function () {
|
||||
return new UserIdentityValue( 0, 'acme>TestUser', 45 );
|
||||
return new UserIdentityValue( 0, 'acme>TestUser' );
|
||||
}, // $actorCallback
|
||||
45, // $expected
|
||||
];
|
||||
|
|
@ -396,14 +396,14 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
];
|
||||
yield 'anon, foreign' => [
|
||||
static function () {
|
||||
return new UserIdentityValue( 0, self::IP, 0, 'acmewiki' );
|
||||
return new UserIdentityValue( 0, self::IP, 'acmewiki' );
|
||||
}, // $actorCallback
|
||||
43, // $expected
|
||||
'acmewiki', // $wikiId
|
||||
];
|
||||
yield 'registered, foreign' => [
|
||||
static function () {
|
||||
return new UserIdentityValue( 24, 'TestUser', 0, 'acmewiki' );
|
||||
return new UserIdentityValue( 24, 'TestUser', 'acmewiki' );
|
||||
}, // $actorCallback
|
||||
42, // $expected
|
||||
'acmewiki', // $wikiId
|
||||
|
|
@ -421,12 +421,18 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
$wikiId,
|
||||
function ( ActorStore $store ) use ( $expected, $actor ) {
|
||||
$this->assertSame( $expected, $store->findActorId( $actor, $this->db ) );
|
||||
$this->assertSame( $expected ?: 0, $actor->getActorId( $actor->getWikiId() ) );
|
||||
|
||||
if ( $actor instanceof User ) {
|
||||
$this->assertSame( $expected ?: 0, $actor->getActorId() );
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
$this->assertSame( $expected, $this->getStore()->findActorId( $actor, $this->db ) );
|
||||
$this->assertSame( $expected ?: 0, $actor->getActorId( $actor->getWikiId() ) );
|
||||
|
||||
if ( $actor instanceof User ) {
|
||||
$this->assertSame( $expected ?: 0, $actor->getActorId() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -437,7 +443,7 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
$this->markTestSkipped();
|
||||
$this->expectException( PreconditionException::class );
|
||||
$this->getStore()->findActorId(
|
||||
new UserIdentityValue( 0, self::IP, 0, 'acmewiki' ),
|
||||
new UserIdentityValue( 0, self::IP, 'acmewiki' ),
|
||||
$this->db
|
||||
);
|
||||
}
|
||||
|
|
@ -487,10 +493,10 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
|
||||
public function provideAcquireActorId() {
|
||||
yield 'anon' => [ static function () {
|
||||
return new UserIdentityValue( 0, '127.3.2.1', 0 );
|
||||
return new UserIdentityValue( 0, '127.3.2.1' );
|
||||
} ];
|
||||
yield 'registered' => [ static function () {
|
||||
return new UserIdentityValue( 15, 'MyUser', 0 );
|
||||
return new UserIdentityValue( 15, 'MyUser' );
|
||||
} ];
|
||||
yield 'User object' => [ static function ( $serviceContainer ) {
|
||||
return $serviceContainer->getUserFactory()->newAnonymous( '127.4.3.2' );
|
||||
|
|
@ -505,15 +511,18 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
$user = $userCallback( $this->getServiceContainer() );
|
||||
$actorId = $this->getStore()->acquireActorId( $user, $this->db );
|
||||
$this->assertTrue( $actorId > 0 );
|
||||
$this->assertSame( $actorId, $user->getActorId() );
|
||||
|
||||
if ( $user instanceof User ) {
|
||||
$this->assertSame( $actorId, $user->getActorId() );
|
||||
}
|
||||
}
|
||||
|
||||
public function provideAcquireActorId_foreign() {
|
||||
yield 'anon' => [ static function () {
|
||||
return new UserIdentityValue( 0, '127.3.2.1', 0, 'acmewiki' );
|
||||
return new UserIdentityValue( 0, '127.3.2.1', 'acmewiki' );
|
||||
} ];
|
||||
yield 'registered' => [ static function () {
|
||||
return new UserIdentityValue( 15, 'MyUser', 0, 'acmewiki' );
|
||||
return new UserIdentityValue( 15, 'MyUser', 'acmewiki' );
|
||||
} ];
|
||||
}
|
||||
|
||||
|
|
@ -528,7 +537,9 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
function ( ActorStore $store ) use ( $user ) {
|
||||
$actorId = $store->acquireActorId( $user, $this->db );
|
||||
$this->assertTrue( $actorId > 0 );
|
||||
$this->assertSame( $actorId, $user->getActorId( $user->getWikiId() ) );
|
||||
if ( $user instanceof User ) {
|
||||
$this->assertSame( $actorId, $user->getActorId() );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -544,14 +555,16 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
function ( ActorStore $store, IDatabase $dbw ) use ( $user ) {
|
||||
$actorId = $store->acquireActorId( $user, $dbw );
|
||||
$this->assertTrue( $actorId > 0 );
|
||||
$this->assertSame( $actorId, $user->getActorId( $user->getWikiId() ) );
|
||||
if ( $user instanceof User ) {
|
||||
$this->assertSame( $actorId, $user->getActorId() );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public function provideAcquireActorId_canNotCreate() {
|
||||
yield 'usable name' => [ new UserIdentityValue( 0, 'MyFancyUser', 0 ) ];
|
||||
yield 'empty name' => [ new UserIdentityValue( 15, '', 0 ) ];
|
||||
yield 'usable name' => [ new UserIdentityValue( 0, 'MyFancyUser' ) ];
|
||||
yield 'empty name' => [ new UserIdentityValue( 15, '' ) ];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -565,11 +578,11 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
|
||||
public function provideAcquireActorId_existing() {
|
||||
yield 'anon' => [
|
||||
new UserIdentityValue( 0, self::IP, 43 ), // $actor
|
||||
new UserIdentityValue( 0, self::IP ), // $actor
|
||||
43, // $expected
|
||||
];
|
||||
yield 'registered' => [
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ), // $actor
|
||||
new UserIdentityValue( 24, 'TestUser' ), // $actor
|
||||
42, // $expected
|
||||
];
|
||||
}
|
||||
|
|
@ -585,7 +598,7 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
public function testAcquireActorId_domain_mismatch() {
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
$this->getStore( 'fancywiki' )->acquireActorId(
|
||||
new UserIdentityValue( 15, 'Test', 0, 'fancywiki' ),
|
||||
new UserIdentityValue( 15, 'Test', 'fancywiki' ),
|
||||
$this->db
|
||||
);
|
||||
}
|
||||
|
|
@ -597,7 +610,7 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
$this->markTestSkipped();
|
||||
$this->expectException( PreconditionException::class );
|
||||
$this->getStore()->acquireActorId(
|
||||
new UserIdentityValue( 0, self::IP, 0, 'acmewiki' ),
|
||||
new UserIdentityValue( 0, self::IP, 'acmewiki' ),
|
||||
$this->db
|
||||
);
|
||||
}
|
||||
|
|
@ -640,7 +653,6 @@ class ActorStoreTest extends ActorStoreTestBase {
|
|||
$store = $this->getStore();
|
||||
$unknownActor = $store->getUnknownActor();
|
||||
$this->assertInstanceOf( UserIdentity::class, $unknownActor );
|
||||
$this->assertTrue( $unknownActor->getActorId( UserIdentity::LOCAL ) > 0 );
|
||||
$this->assertSame( ActorStore::UNKNOWN_USER_NAME, $unknownActor->getName() );
|
||||
$this->assertSameActors( $unknownActor, $store->getUnknownActor() );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@ abstract class ActorStoreTestBase extends MediaWikiIntegrationTestCase {
|
|||
$wikiId = UserIdentity::LOCAL
|
||||
) {
|
||||
$actor->assertWiki( $wikiId );
|
||||
$this->assertSame( $expected->getActorId( $wikiId ), $actor->getActorId( $wikiId ) );
|
||||
$this->assertSame( $expected->getId( $wikiId ), $actor->getId( $wikiId ) );
|
||||
$this->assertSame( $expected->getName(), $actor->getName() );
|
||||
$this->assertSame( $expected->getWikiId(), $actor->getWikiId() );
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class UserFactoryTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public function testNewFromIdentity() {
|
||||
$identity = new UserIdentityValue( 98257, __METHOD__, 0 );
|
||||
$identity = new UserIdentityValue( 98257, __METHOD__ );
|
||||
|
||||
$factory = $this->getUserFactory();
|
||||
$user = $factory->newFromUserIdentity( $identity );
|
||||
|
|
@ -67,7 +67,7 @@ class UserFactoryTest extends MediaWikiIntegrationTestCase {
|
|||
$this->assertSame( $user, $factory->newFromUserIdentity( $identity ) );
|
||||
|
||||
// make sure instance caching distingushes between IDs
|
||||
$otherIdentity = new UserIdentityValue( 33245, __METHOD__, 0 );
|
||||
$otherIdentity = new UserIdentityValue( 33245, __METHOD__ );
|
||||
$this->assertNotSame( $user, $factory->newFromUserIdentity( $otherIdentity ) );
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ class UserFactoryTest extends MediaWikiIntegrationTestCase {
|
|||
$id = 23560;
|
||||
$name = 'UserFactoryTest3';
|
||||
|
||||
$userIdentity = new UserIdentityValue( $id, $name, 0 );
|
||||
$userIdentity = new UserIdentityValue( $id, $name );
|
||||
$factory = $this->getUserFactory();
|
||||
|
||||
$user1 = $factory->newFromUserIdentity( $userIdentity );
|
||||
|
|
@ -176,7 +176,7 @@ class UserFactoryTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \MediaWiki\User\UserFactory::newFromAuthority
|
||||
*/
|
||||
public function testNewFromAuthority() {
|
||||
$authority = new UltimateAuthority( new UserIdentityValue( 42, 'Test', 0 ) );
|
||||
$authority = new UltimateAuthority( new UserIdentityValue( 42, 'Test' ) );
|
||||
$user = $this->getUserFactory()->newFromAuthority( $authority );
|
||||
$this->assertSame( 42, $user->getId() );
|
||||
$this->assertSame( 'Test', $user->getName() );
|
||||
|
|
|
|||
|
|
@ -23,15 +23,15 @@ class UserSelectQueryBuilderTest extends ActorStoreTestBase {
|
|||
'Test', // $prefix
|
||||
[ 'limit' => 100 ], // $options
|
||||
[
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 25, 'TestUser1', 44 ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
new UserIdentityValue( 25, 'TestUser1' ),
|
||||
], // $expected
|
||||
];
|
||||
yield 'limited' => [
|
||||
'Test', // $prefix
|
||||
[ 'limit' => 1 ], // $options
|
||||
[
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
], // $expected
|
||||
];
|
||||
yield 'sorted' => [
|
||||
|
|
@ -41,8 +41,8 @@ class UserSelectQueryBuilderTest extends ActorStoreTestBase {
|
|||
'limit' => 100,
|
||||
], // $options
|
||||
[
|
||||
new UserIdentityValue( 25, 'TestUser1', 44 ),
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 25, 'TestUser1' ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
], // $expected
|
||||
];
|
||||
}
|
||||
|
|
@ -69,16 +69,16 @@ class UserSelectQueryBuilderTest extends ActorStoreTestBase {
|
|||
[ 24, 25 ], // ids
|
||||
[], // $options
|
||||
[
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 25, 'TestUser1', 44 ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
new UserIdentityValue( 25, 'TestUser1' ),
|
||||
], // $expected
|
||||
];
|
||||
yield 'sorted' => [
|
||||
[ 24, 25 ], // ids
|
||||
[ 'sort' => UserSelectQueryBuilder::SORT_DESC ], // $options
|
||||
[
|
||||
new UserIdentityValue( 25, 'TestUser1', 44 ),
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 25, 'TestUser1' ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
], // $expected
|
||||
];
|
||||
}
|
||||
|
|
@ -106,30 +106,30 @@ class UserSelectQueryBuilderTest extends ActorStoreTestBase {
|
|||
[ 'TestUser', 'TestUser1' ], // $names
|
||||
[], // $options
|
||||
[
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 25, 'TestUser1', 44 ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
new UserIdentityValue( 25, 'TestUser1' ),
|
||||
], // $expected
|
||||
];
|
||||
yield 'sorted' => [
|
||||
[ 'TestUser', 'TestUser1' ], // $names
|
||||
[ 'sort' => UserSelectQueryBuilder::SORT_DESC ], // $options
|
||||
[
|
||||
new UserIdentityValue( 25, 'TestUser1', 44 ),
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 25, 'TestUser1' ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
], // $expected
|
||||
];
|
||||
yield 'with IPs' => [
|
||||
[ self::IP ], // $names
|
||||
[], // $options
|
||||
[
|
||||
new UserIdentityValue( 0, self::IP, 43 ),
|
||||
new UserIdentityValue( 0, self::IP ),
|
||||
], // $expected
|
||||
];
|
||||
yield 'with IPs, normalization' => [
|
||||
[ strtolower( self::IP ), self::IP ], // $names
|
||||
[], // $options
|
||||
[
|
||||
new UserIdentityValue( 0, self::IP, 43 ),
|
||||
new UserIdentityValue( 0, self::IP ),
|
||||
], // $expected
|
||||
];
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ class UserSelectQueryBuilderTest extends ActorStoreTestBase {
|
|||
*/
|
||||
public function testFetchUserIdentity() {
|
||||
$this->assertSameActors(
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
$this->getStore()
|
||||
->newSelectQueryBuilder()
|
||||
->userIds( 24 )
|
||||
|
|
@ -191,7 +191,7 @@ class UserSelectQueryBuilderTest extends ActorStoreTestBase {
|
|||
);
|
||||
$this->assertCount( 1, $actors );
|
||||
$this->assertSameActors(
|
||||
new UserIdentityValue( 24, 'TestUser', 42 ),
|
||||
new UserIdentityValue( 24, 'TestUser' ),
|
||||
$actors[0]
|
||||
);
|
||||
}
|
||||
|
|
@ -210,7 +210,7 @@ class UserSelectQueryBuilderTest extends ActorStoreTestBase {
|
|||
);
|
||||
$this->assertCount( 2, $actors );
|
||||
$this->assertSameActors(
|
||||
new UserIdentityValue( 0, self::IP, 43 ),
|
||||
new UserIdentityValue( 0, self::IP ),
|
||||
$actors[0]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ trait MockAuthorityTrait {
|
|||
* @return Authority
|
||||
*/
|
||||
private function mockAnonUltimateAuthority(): Authority {
|
||||
return new UltimateAuthority( new UserIdentityValue( 0, '127.0.0.1', 0 ) );
|
||||
return new UltimateAuthority( new UserIdentityValue( 0, '127.0.0.1' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,7 @@ trait MockAuthorityTrait {
|
|||
* @return Authority
|
||||
*/
|
||||
private function mockRegisteredUltimateAuthority(): Authority {
|
||||
return new UltimateAuthority( new UserIdentityValue( 42, 'Petr', 24 ) );
|
||||
return new UltimateAuthority( new UserIdentityValue( 42, 'Petr' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +37,7 @@ trait MockAuthorityTrait {
|
|||
* @return Authority
|
||||
*/
|
||||
private function mockAnonNullAuthority(): Authority {
|
||||
return new SimpleAuthority( new UserIdentityValue( 0, '127.0.0.1', 0 ), [] );
|
||||
return new SimpleAuthority( new UserIdentityValue( 0, '127.0.0.1' ), [] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -46,7 +46,7 @@ trait MockAuthorityTrait {
|
|||
* @return Authority
|
||||
*/
|
||||
private function mockRegisteredNullAuthority(): Authority {
|
||||
return new SimpleAuthority( new UserIdentityValue( 42, 'Petr', 24 ), [] );
|
||||
return new SimpleAuthority( new UserIdentityValue( 42, 'Petr' ), [] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,7 +56,7 @@ trait MockAuthorityTrait {
|
|||
* @return Authority
|
||||
*/
|
||||
private function mockAnonAuthorityWithPermissions( array $permissions ): Authority {
|
||||
return new SimpleAuthority( new UserIdentityValue( 0, '127.0.0.1', 0 ), $permissions );
|
||||
return new SimpleAuthority( new UserIdentityValue( 0, '127.0.0.1' ), $permissions );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,7 +66,7 @@ trait MockAuthorityTrait {
|
|||
* @return Authority
|
||||
*/
|
||||
private function mockRegisteredAuthorityWithPermissions( array $permissions ): Authority {
|
||||
return new SimpleAuthority( new UserIdentityValue( 42, 'Petr', 24 ), $permissions );
|
||||
return new SimpleAuthority( new UserIdentityValue( 42, 'Petr' ), $permissions );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -90,7 +90,7 @@ trait MockAuthorityTrait {
|
|||
*/
|
||||
private function mockAnonAuthorityWithoutPermissions( array $permissions ): Authority {
|
||||
return $this->mockUserAuthorityWithoutPermissions(
|
||||
new UserIdentityValue( 0, '127.0.0.1', 0 ),
|
||||
new UserIdentityValue( 0, '127.0.0.1' ),
|
||||
$permissions
|
||||
);
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ trait MockAuthorityTrait {
|
|||
*/
|
||||
private function mockRegisteredAuthorityWithoutPermissions( array $permissions ): Authority {
|
||||
return $this->mockUserAuthorityWithoutPermissions(
|
||||
new UserIdentityValue( 42, 'Petr', 24 ),
|
||||
new UserIdentityValue( 42, 'Petr' ),
|
||||
$permissions
|
||||
);
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ trait MockAuthorityTrait {
|
|||
*/
|
||||
private function mockAnonAuthority( callable $permissionCallback ): Authority {
|
||||
return $this->mockAuthority(
|
||||
new UserIdentityValue( 0, '127.0.0.1', 0 ),
|
||||
new UserIdentityValue( 0, '127.0.0.1' ),
|
||||
$permissionCallback
|
||||
);
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ trait MockAuthorityTrait {
|
|||
*/
|
||||
private function mockRegisteredAuthority( callable $permissionCallback ): Authority {
|
||||
return $this->mockAuthority(
|
||||
new UserIdentityValue( 42, 'Petr', 24 ),
|
||||
new UserIdentityValue( 42, 'Petr' ),
|
||||
$permissionCallback
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class SpecialPageFatalTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
$executor = new SpecialPageExecutor();
|
||||
$authority = new UltimateAuthority( new UserIdentityValue( 0, 'UTSysop', 0 ) );
|
||||
$authority = new UltimateAuthority( new UserIdentityValue( 0, 'UTSysop' ) );
|
||||
|
||||
try {
|
||||
$executor->executeSpecialPage( $page, '', null, 'qqx', $authority );
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@ use MediaWikiUnitTestCase;
|
|||
class SimpleAuthorityTest extends MediaWikiUnitTestCase {
|
||||
|
||||
public function testGetAuthor() {
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new SimpleAuthority( $actor, [] );
|
||||
|
||||
$this->assertSame( $actor, $authority->getUser() );
|
||||
}
|
||||
|
||||
public function testPermissions() {
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new SimpleAuthority( $actor, [ 'foo', 'bar' ] );
|
||||
|
||||
$this->assertTrue( $authority->isAllowed( 'foo' ) );
|
||||
|
|
@ -57,7 +57,7 @@ class SimpleAuthorityTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function testProbablyCan() {
|
||||
$target = new PageIdentityValue( 321, NS_MAIN, __METHOD__, PageIdentity::LOCAL );
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new SimpleAuthority( $actor, [ 'foo', 'bar' ] );
|
||||
|
||||
$this->assertTrue( $authority->probablyCan( 'foo', $target ) );
|
||||
|
|
@ -74,7 +74,7 @@ class SimpleAuthorityTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function testDefinitlyCan() {
|
||||
$target = new PageIdentityValue( 321, NS_MAIN, __METHOD__, PageIdentity::LOCAL );
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new SimpleAuthority( $actor, [ 'foo', 'bar' ] );
|
||||
|
||||
$this->assertTrue( $authority->definitelyCan( 'foo', $target ) );
|
||||
|
|
@ -91,7 +91,7 @@ class SimpleAuthorityTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function testAuthorizeRead() {
|
||||
$target = new PageIdentityValue( 321, NS_MAIN, __METHOD__, PageIdentity::LOCAL );
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new SimpleAuthority( $actor, [ 'foo', 'bar' ] );
|
||||
|
||||
$this->assertTrue( $authority->authorizeRead( 'foo', $target ) );
|
||||
|
|
@ -108,7 +108,7 @@ class SimpleAuthorityTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function testAuthorizeWrite() {
|
||||
$target = new PageIdentityValue( 321, NS_MAIN, __METHOD__, PageIdentity::LOCAL );
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new SimpleAuthority( $actor, [ 'foo', 'bar' ] );
|
||||
|
||||
$this->assertTrue( $authority->authorizeWrite( 'foo', $target ) );
|
||||
|
|
@ -124,7 +124,7 @@ class SimpleAuthorityTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testIsAllowedAnyThrowsOnEmptySet() {
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new SimpleAuthority( $actor, [ 'foo', 'bar' ] );
|
||||
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
|
|
@ -132,7 +132,7 @@ class SimpleAuthorityTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testIsAllowedAllThrowsOnEmptySet() {
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new SimpleAuthority( $actor, [ 'foo', 'bar' ] );
|
||||
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@ use MediaWikiUnitTestCase;
|
|||
class UltimateAuthorityTest extends MediaWikiUnitTestCase {
|
||||
|
||||
public function testGetAuthor() {
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new UltimateAuthority( $actor );
|
||||
|
||||
$this->assertSame( $actor, $authority->getUser() );
|
||||
}
|
||||
|
||||
public function testPermissions() {
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new UltimateAuthority( $actor );
|
||||
|
||||
$this->assertTrue( $authority->isAllowed( 'foo' ) );
|
||||
|
|
@ -53,7 +53,7 @@ class UltimateAuthorityTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function testProbablyCan() {
|
||||
$target = new PageIdentityValue( 321, NS_MAIN, __METHOD__, PageIdentity::LOCAL );
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new UltimateAuthority( $actor );
|
||||
|
||||
$this->assertTrue( $authority->probablyCan( 'foo', $target ) );
|
||||
|
|
@ -66,7 +66,7 @@ class UltimateAuthorityTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function testDefinitlyCan() {
|
||||
$target = new PageIdentityValue( 321, NS_MAIN, __METHOD__, PageIdentity::LOCAL );
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new UltimateAuthority( $actor );
|
||||
|
||||
$this->assertTrue( $authority->definitelyCan( 'foo', $target ) );
|
||||
|
|
@ -79,7 +79,7 @@ class UltimateAuthorityTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function testAuthorizeRead() {
|
||||
$target = new PageIdentityValue( 321, NS_MAIN, __METHOD__, PageIdentity::LOCAL );
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new UltimateAuthority( $actor );
|
||||
|
||||
$this->assertTrue( $authority->authorizeRead( 'foo', $target ) );
|
||||
|
|
@ -92,7 +92,7 @@ class UltimateAuthorityTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function testAuthorizeWrite() {
|
||||
$target = new PageIdentityValue( 321, NS_MAIN, __METHOD__, PageIdentity::LOCAL );
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new UltimateAuthority( $actor );
|
||||
|
||||
$this->assertTrue( $authority->authorizeWrite( 'foo', $target ) );
|
||||
|
|
@ -104,7 +104,7 @@ class UltimateAuthorityTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testIsAllowedAnyThrowsOnEmptySet() {
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new UltimateAuthority( $actor );
|
||||
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
|
|
@ -112,7 +112,7 @@ class UltimateAuthorityTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testIsAllowedAllThrowsOnEmptySet() {
|
||||
$actor = new UserIdentityValue( 12, 'Test', 17 );
|
||||
$actor = new UserIdentityValue( 12, 'Test' );
|
||||
$authority = new UltimateAuthority( $actor );
|
||||
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class ContributionsCountHandlerTest extends \MediaWikiUnitTestCase {
|
|||
[ 'getContributionCount' ]
|
||||
);
|
||||
$username = $request->getPathParams()['user'] ?? null;
|
||||
$user = $username ? new UserIdentityValue( 42, $username, 24 ) : null;
|
||||
$user = $username ? new UserIdentityValue( 42, $username ) : null;
|
||||
|
||||
$tag = $request->getQueryParams()['tag'] ?? null;
|
||||
$mockContributionsLookup->method( 'getContributionCount' )
|
||||
|
|
@ -110,7 +110,7 @@ class ContributionsCountHandlerTest extends \MediaWikiUnitTestCase {
|
|||
$request = new RequestData( $config );
|
||||
$username = $request->getPathParams()['user'] ?? null;
|
||||
$validatedParams = [
|
||||
'user' => $username ? new UserIdentityValue( 42, $username, 24 ) : null,
|
||||
'user' => $username ? new UserIdentityValue( 42, $username ) : null,
|
||||
'tag' => null
|
||||
];
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ class ContributionsCountHandlerTest extends \MediaWikiUnitTestCase {
|
|||
$request = new RequestData( [ 'pathParams' => [ 'user' => $username ] ] );
|
||||
|
||||
$validatedParams = [
|
||||
'user' => new UserIdentityValue( 0, $username, 0 ),
|
||||
'user' => new UserIdentityValue( 0, $username ),
|
||||
'tag' => null
|
||||
];
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ class ContributionsCountHandlerTest extends \MediaWikiUnitTestCase {
|
|||
$ipAddr = '127.0.0.1';
|
||||
$request = new RequestData( [ 'pathParams' => [ 'user' => $ipAddr ] ] );
|
||||
$validatedParams = [
|
||||
'user' => new UserIdentityValue( 0, $ipAddr, 0 ),
|
||||
'user' => new UserIdentityValue( 0, $ipAddr ),
|
||||
'tag' => null
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ class UserContributionsHandlerTest extends \MediaWikiUnitTestCase {
|
|||
*/
|
||||
public function testThatParametersAreHandledCorrectlyForUserEndpoint( $queryParams ) {
|
||||
$username = 'Test';
|
||||
$target = new UserIdentityValue( 7, $username, 7 );
|
||||
$target = new UserIdentityValue( 7, $username );
|
||||
$performer = $this->mockRegisteredUltimateAuthority();
|
||||
$request = new RequestData( [
|
||||
'pathParams' => [ 'user' => $target->getName() ],
|
||||
|
|
@ -218,7 +218,7 @@ class UserContributionsHandlerTest extends \MediaWikiUnitTestCase {
|
|||
$request = new RequestData( [] );
|
||||
// UserDef transforms parameter name to ip
|
||||
$validatedParams = [
|
||||
'ip' => new UserIdentityValue( 0, '127.0.0.1', 0 ),
|
||||
'ip' => new UserIdentityValue( 0, '127.0.0.1' ),
|
||||
'limit' => self::DEFAULT_LIMIT,
|
||||
'tag' => null,
|
||||
'segment' => ''
|
||||
|
|
@ -234,7 +234,7 @@ class UserContributionsHandlerTest extends \MediaWikiUnitTestCase {
|
|||
$username = 'UNKNOWN';
|
||||
$request = new RequestData( [ 'pathParams' => [ 'user' => $username ] ] );
|
||||
$validatedParams = [
|
||||
'user' => new UserIdentityValue( 0, $username, 0 ),
|
||||
'user' => new UserIdentityValue( 0, $username ),
|
||||
'limit' => self::DEFAULT_LIMIT,
|
||||
'tag' => null,
|
||||
'segment' => ''
|
||||
|
|
@ -252,7 +252,7 @@ class UserContributionsHandlerTest extends \MediaWikiUnitTestCase {
|
|||
$requestData = [ 'pathParams' => [ 'user' => $username ] ];
|
||||
$request = new RequestData( $requestData );
|
||||
$validatedParams = [
|
||||
'user' => new UserIdentityValue( 0, $username, 0 ),
|
||||
'user' => new UserIdentityValue( 0, $username ),
|
||||
'limit' => self::DEFAULT_LIMIT,
|
||||
'tag' => null,
|
||||
'segment' => ''
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class MutableRevisionRecordTest extends MediaWikiUnitTestCase {
|
|||
* @return MutableRevisionRecord
|
||||
*/
|
||||
protected function newRevision( array $rowOverrides = [] ) {
|
||||
$user = new UserIdentityValue( 11, 'Tester', 0 );
|
||||
$user = new UserIdentityValue( 11, 'Tester' );
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
|
||||
$wikiId = $rowOverrides['wikiId'] ?? RevisionRecord::LOCAL;
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ class MutableRevisionRecordTest extends MediaWikiUnitTestCase {
|
|||
$record = new MutableRevisionRecord(
|
||||
new PageIdentityValue( 1, NS_MAIN, 'Foo', PageIdentity::LOCAL )
|
||||
);
|
||||
$user = new UserIdentityValue( 0, 'Bla', 0 );
|
||||
$user = new UserIdentityValue( 0, 'Bla' );
|
||||
$this->assertNull( $record->getUser() );
|
||||
$record->setUser( $user );
|
||||
$this->assertSame( $user, $record->getUser() );
|
||||
|
|
@ -351,7 +351,7 @@ class MutableRevisionRecordTest extends MediaWikiUnitTestCase {
|
|||
|
||||
public function provideNotReadyForInsertion() {
|
||||
$title = $this->makeMockTitle( 'Dummy' );
|
||||
$user = new UserIdentityValue( 42, 'Test', 24 );
|
||||
$user = new UserIdentityValue( 42, 'Test' );
|
||||
|
||||
/** @var CommentStoreComment $comment */
|
||||
$comment = $this->getMockBuilder( CommentStoreComment::class )
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class RevisionArchiveRecordTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$title = new PageIdentityValue( 17, NS_MAIN, 'Dummy', $wikiId );
|
||||
|
||||
$user = new UserIdentityValue( 11, 'Tester', 0 );
|
||||
$user = new UserIdentityValue( 11, 'Tester' );
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
|
||||
|
||||
$main = SlotRecord::newUnsaved( SlotRecord::MAIN, new DummyContentForTesting( 'Lorem Ipsum' ) );
|
||||
|
|
|
|||
|
|
@ -456,7 +456,7 @@ trait RevisionRecordTests {
|
|||
|
||||
return new RevisionStoreRecord(
|
||||
$this->makeMockTitle( 'provideHasSameContent', [ 'id' => 19 ] ),
|
||||
new UserIdentityValue( 11, __METHOD__, 0 ),
|
||||
new UserIdentityValue( 11, __METHOD__ ),
|
||||
CommentStoreComment::newUnsavedComment( __METHOD__ ),
|
||||
(object)[
|
||||
'rev_id' => strval( $revId ),
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class RevisionStoreCacheRecordTest extends RevisionStoreRecordTest {
|
|||
|
||||
$title = new PageIdentityValue( 17, NS_MAIN, 'Dummy', $wikiId );
|
||||
|
||||
$user = new UserIdentityValue( 11, 'Tester', 0 );
|
||||
$user = new UserIdentityValue( 11, 'Tester' );
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
|
||||
|
||||
$main = SlotRecord::newUnsaved( SlotRecord::MAIN, new DummyContentForTesting( 'Lorem Ipsum' ) );
|
||||
|
|
@ -59,7 +59,7 @@ class RevisionStoreCacheRecordTest extends RevisionStoreRecordTest {
|
|||
$this->assertSame( 7, $revId );
|
||||
return [
|
||||
$row['rev_deleted'],
|
||||
new UserIdentityValue( intval( $row['rev_user'] ), 'Bla', 10 )
|
||||
new UserIdentityValue( intval( $row['rev_user'] ), 'Bla' )
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ class RevisionStoreCacheRecordTest extends RevisionStoreRecordTest {
|
|||
$callbackInvoked++;
|
||||
return [
|
||||
RevisionRecord::DELETED_TEXT,
|
||||
new UserIdentityValue( 12, 'Lalala', 24 )
|
||||
new UserIdentityValue( 12, 'Lalala' )
|
||||
];
|
||||
};
|
||||
$rev = $this->newRevision( [], $callback );
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class RevisionStoreRecordTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$title = new PageIdentityValue( 17, NS_MAIN, 'Dummy', $wikiId );
|
||||
|
||||
$user = new UserIdentityValue( 11, 'Tester', 0 );
|
||||
$user = new UserIdentityValue( 11, 'Tester' );
|
||||
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
|
||||
|
||||
$main = SlotRecord::newUnsaved( SlotRecord::MAIN, new DummyContentForTesting( 'Lorem Ipsum' ) );
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ class StaticUserOptionsLookupTest extends MediaWikiUnitTestCase {
|
|||
],
|
||||
[ 'opt1' => 'val1def', 'opt4' => 'val4def' ]
|
||||
);
|
||||
$user1 = new UserIdentityValue( 1, 'User1', 1 );
|
||||
$user2 = new UserIdentityValue( 2, 'User2', 2 );
|
||||
$user3 = new UserIdentityValue( 3, 'User3', 3 );
|
||||
$fakeUser1 = new UserIdentityValue( 0, 'User1', 4 );
|
||||
$user1 = new UserIdentityValue( 1, 'User1' );
|
||||
$user2 = new UserIdentityValue( 2, 'User2' );
|
||||
$user3 = new UserIdentityValue( 3, 'User3' );
|
||||
$fakeUser1 = new UserIdentityValue( 0, 'User1' );
|
||||
|
||||
$this->assertSame( 'val1', $lookup->getOption( $user1, 'opt1' ) );
|
||||
$this->assertSame( 'val1', $lookup->getOption( $user1, 'opt1', 'def' ) );
|
||||
|
|
@ -76,10 +76,10 @@ class StaticUserOptionsLookupTest extends MediaWikiUnitTestCase {
|
|||
],
|
||||
[ 'opt1' => 'val1def', 'opt4' => 'val4def' ]
|
||||
);
|
||||
$user1 = new UserIdentityValue( 1, 'User1', 1 );
|
||||
$user2 = new UserIdentityValue( 2, 'User2', 2 );
|
||||
$user3 = new UserIdentityValue( 3, 'User3', 3 );
|
||||
$fakeUser1 = new UserIdentityValue( 0, 'User1', 4 );
|
||||
$user1 = new UserIdentityValue( 1, 'User1' );
|
||||
$user2 = new UserIdentityValue( 2, 'User2' );
|
||||
$user3 = new UserIdentityValue( 3, 'User3' );
|
||||
$fakeUser1 = new UserIdentityValue( 0, 'User1' );
|
||||
|
||||
$this->assertArrayEquals( [ 'opt1' => 'val1', 'opt2' => 'val2', 'opt4' => 'val4def' ],
|
||||
$lookup->getOptions( $user1 ) );
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class UserEditTrackerTest extends MediaWikiUnitTestCase {
|
|||
->with( DB_REPLICA )
|
||||
->willReturn( $database );
|
||||
|
||||
$user = new UserIdentityValue( $userId, 'TestUser', 0 );
|
||||
$user = new UserIdentityValue( $userId, 'TestUser' );
|
||||
|
||||
$jobQueueGroup = $this->createMock( JobQueueGroup::class );
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ class UserEditTrackerTest extends MediaWikiUnitTestCase {
|
|||
$loadBalancer = $this->createMock( LoadBalancer::class );
|
||||
|
||||
$user = $this->createMock( UserIdentity::class );
|
||||
$user = new UserIdentityValue( $userId, 'TestUser', 0 );
|
||||
$user = new UserIdentityValue( $userId, 'TestUser' );
|
||||
|
||||
$jobQueueGroup = $this->createMock( JobQueueGroup::class );
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ class UserEditTrackerTest extends MediaWikiUnitTestCase {
|
|||
$methodName2 = 'MediaWiki\User\UserEditTracker::initializeUserEditCount';
|
||||
$editCount = 17;
|
||||
|
||||
$user = new UserIdentityValue( $userId, 'TestUser', 0 );
|
||||
$user = new UserIdentityValue( $userId, 'TestUser' );
|
||||
|
||||
$database1 = $this->createMock( Database::class );
|
||||
$database1->expects( $this->once() )
|
||||
|
|
@ -181,7 +181,7 @@ class UserEditTrackerTest extends MediaWikiUnitTestCase {
|
|||
$methodName = 'MediaWiki\User\UserEditTracker::initializeUserEditCount';
|
||||
$editCount = 341;
|
||||
|
||||
$user = new UserIdentityValue( $userId, 'TestUser', 0 );
|
||||
$user = new UserIdentityValue( $userId, 'TestUser' );
|
||||
|
||||
$database1 = $this->createMock( Database::class );
|
||||
$database1->expects( $this->once() )
|
||||
|
|
@ -250,7 +250,7 @@ class UserEditTrackerTest extends MediaWikiUnitTestCase {
|
|||
$methodName = 'MediaWiki\User\UserEditTracker::getUserEditTimestamp';
|
||||
$actorId = 982110;
|
||||
|
||||
$user = new UserIdentityValue( 1, 'TestUser', $actorId );
|
||||
$user = new UserIdentityValue( 1, 'TestUser' );
|
||||
|
||||
$expectedSort = ( $type === 'first' ) ? 'ASC' : 'DESC';
|
||||
$dbTime = ( $time === 'null' ) ? null : $time;
|
||||
|
|
@ -325,7 +325,7 @@ class UserEditTrackerTest extends MediaWikiUnitTestCase {
|
|||
$actorMigration = $this->createMock( ActorMigration::class );
|
||||
$loadBalancer = $this->createMock( LoadBalancer::class );
|
||||
|
||||
$user = new UserIdentityValue( 0, 'TestUser', 0 );
|
||||
$user = new UserIdentityValue( 0, 'TestUser' );
|
||||
|
||||
$jobQueueGroup = $this->createMock( JobQueueGroup::class );
|
||||
|
||||
|
|
@ -341,9 +341,9 @@ class UserEditTrackerTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$tracker = new UserEditTracker( $actorMigration, $loadBalancer, $jobQueueGroup );
|
||||
|
||||
$anon = new UserIdentityValue( 0, 'TestUser', 0 );
|
||||
$anon = new UserIdentityValue( 0, 'TestUser' );
|
||||
|
||||
$user = new UserIdentityValue( 123, 'TestUser', 0 );
|
||||
$user = new UserIdentityValue( 123, 'TestUser' );
|
||||
|
||||
$accessible = TestingAccessWrapper::newFromObject( $tracker );
|
||||
$accessible->userEditCountCache = [ 'u123' => 5 ];
|
||||
|
|
|
|||
|
|
@ -12,68 +12,53 @@ class UserIdentityValueTest extends MediaWikiUnitTestCase {
|
|||
/**
|
||||
* @covers ::getActorId
|
||||
*/
|
||||
public function testGetActorIdLocalUIVNoParam() {
|
||||
$id = 88888888;
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $id, UserIdentityValue::LOCAL );
|
||||
public function testGetActorIdLocalUIVForeignParam() {
|
||||
$foreignWikiId = 'Foreign Wiki';
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', UserIdentityValue::LOCAL );
|
||||
|
||||
$this->assertEquals( $id, $user->getActorId() );
|
||||
$this->expectDeprecation();
|
||||
$this->assertSame( 0, $user->getActorId( $foreignWikiId ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::getActorId
|
||||
*/
|
||||
public function testGetActorIdDeprecated() {
|
||||
$user = new UserIdentityValue( 0, 'TestUserName' );
|
||||
|
||||
$this->expectDeprecation();
|
||||
$this->assertSame( 0, $user->getActorId() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::getActorId
|
||||
*/
|
||||
public function testGetActorIdLocalUIVNoParam() {
|
||||
$this->filterDeprecated( '/UserIdentityValue::getActorId was deprecated/' );
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', UserIdentityValue::LOCAL );
|
||||
|
||||
$this->assertSame( 0, $user->getActorId() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::getActorId
|
||||
*/
|
||||
public function testGetActorIdLocalUIVLocalParam() {
|
||||
$id = 88888888;
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $id, UserIdentityValue::LOCAL );
|
||||
$this->filterDeprecated( '/UserIdentityValue::getActorId was deprecated/' );
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', UserIdentityValue::LOCAL );
|
||||
|
||||
$this->assertEquals( $id, $user->getActorId( UserIdentityValue::LOCAL ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::getActorId
|
||||
*/
|
||||
public function testGetActorIdLocalUIVForeignParam() {
|
||||
$foreignWikiId = 'Foreign Wiki';
|
||||
$id = 88888888;
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $id, UserIdentityValue::LOCAL );
|
||||
|
||||
$this->expectDeprecation();
|
||||
$this->assertEquals( $id, $user->getActorId( $foreignWikiId ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::getActorId
|
||||
*/
|
||||
public function testGetActorIdForeignUIVNoParam() {
|
||||
$foreignWikiId = 'Foreign Wiki';
|
||||
$id = 88888888;
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $id, $foreignWikiId );
|
||||
|
||||
$this->expectDeprecation();
|
||||
$this->assertEquals( $id, $user->getActorId() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::getActorId
|
||||
*/
|
||||
public function testGetActorIdForeignUIVLocalParam() {
|
||||
$foreignWikiId = 'Foreign Wiki';
|
||||
$id = 88888888;
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $id, $foreignWikiId );
|
||||
|
||||
$this->expectDeprecation();
|
||||
$this->assertEquals( $id, $user->getActorId( UserIdentityValue::LOCAL ) );
|
||||
$this->assertSame( 0, $user->getActorId( UserIdentityValue::LOCAL ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::getActorId
|
||||
*/
|
||||
public function testGetActorIdForeignUIVForeignParam() {
|
||||
$this->filterDeprecated( '/UserIdentityValue::getActorId was deprecated/' );
|
||||
$foreignWikiId = 'Foreign Wiki';
|
||||
$id = 88888888;
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $id, $foreignWikiId );
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $foreignWikiId );
|
||||
|
||||
$this->assertEquals( $id, $user->getActorId( $foreignWikiId ) );
|
||||
$this->assertSame( 0, $user->getActorId( $foreignWikiId ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -90,7 +75,7 @@ class UserIdentityValueTest extends MediaWikiUnitTestCase {
|
|||
* @param string|false $wikiId
|
||||
*/
|
||||
public function testGetWiki( $wikiId ) {
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', 0, $wikiId );
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $wikiId );
|
||||
$this->assertSame( $wikiId, $user->getWikiId() );
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +84,7 @@ class UserIdentityValueTest extends MediaWikiUnitTestCase {
|
|||
*/
|
||||
public function testAssertWikiLocalUIV() {
|
||||
$foreignWikiId = 'Foreign Wiki';
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', 0, UserIdentityValue::LOCAL );
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', UserIdentityValue::LOCAL );
|
||||
|
||||
$user->assertWiki( UserIdentityValue::LOCAL );
|
||||
$this->assertTrue( true, 'User is for same wiki' );
|
||||
|
|
@ -113,7 +98,7 @@ class UserIdentityValueTest extends MediaWikiUnitTestCase {
|
|||
*/
|
||||
public function testAssertWikiForeignUIV() {
|
||||
$foreignWikiId = 'Foreign Wiki';
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', 0, $foreignWikiId );
|
||||
$user = new UserIdentityValue( 0, 'TestUserName', $foreignWikiId );
|
||||
|
||||
$user->assertWiki( $foreignWikiId );
|
||||
$this->assertTrue( true, 'User is for same wiki' );
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
|
||||
$this->expectException( DBReadOnlyError::class );
|
||||
$noWriteService->addWatch(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ), new TitleValue( 0, 'Foo' ) );
|
||||
new UserIdentityValue( 1, 'MockUser' ), new TitleValue( 0, 'Foo' ) );
|
||||
}
|
||||
|
||||
public function testAddWatchBatchForUser() {
|
||||
|
|
@ -28,7 +28,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
$noWriteService = new NoWriteWatchedItemStore( $innerService );
|
||||
|
||||
$this->expectException( DBReadOnlyError::class );
|
||||
$noWriteService->addWatchBatchForUser( new UserIdentityValue( 1, 'MockUser', 0 ), [] );
|
||||
$noWriteService->addWatchBatchForUser( new UserIdentityValue( 1, 'MockUser' ), [] );
|
||||
}
|
||||
|
||||
public function testRemoveWatch() {
|
||||
|
|
@ -39,7 +39,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
|
||||
$this->expectException( DBReadOnlyError::class );
|
||||
$noWriteService->removeWatch(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ), new TitleValue( 0, 'Foo' ) );
|
||||
new UserIdentityValue( 1, 'MockUser' ), new TitleValue( 0, 'Foo' ) );
|
||||
}
|
||||
|
||||
public function testSetNotificationTimestampsForUser() {
|
||||
|
|
@ -50,7 +50,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
|
||||
$this->expectException( DBReadOnlyError::class );
|
||||
$noWriteService->setNotificationTimestampsForUser(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
'timestamp',
|
||||
[]
|
||||
);
|
||||
|
|
@ -64,7 +64,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
|
||||
$this->expectException( DBReadOnlyError::class );
|
||||
$noWriteService->updateNotificationTimestamp(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
new TitleValue( 0, 'Foo' ),
|
||||
'timestamp'
|
||||
);
|
||||
|
|
@ -78,7 +78,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
|
||||
$this->expectException( DBReadOnlyError::class );
|
||||
$noWriteService->resetNotificationTimestamp(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
new TitleValue( 0, 'Foo' )
|
||||
);
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
$noWriteService = new NoWriteWatchedItemStore( $innerService );
|
||||
|
||||
$return = $noWriteService->countWatchedItems(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 )
|
||||
new UserIdentityValue( 1, 'MockUser' )
|
||||
);
|
||||
$this->assertEquals( __METHOD__, $return );
|
||||
}
|
||||
|
|
@ -159,7 +159,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
$noWriteService = new NoWriteWatchedItemStore( $innerService );
|
||||
|
||||
$return = $noWriteService->getWatchedItem(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
new TitleValue( 0, 'Foo' )
|
||||
);
|
||||
$this->assertEquals( __METHOD__, $return );
|
||||
|
|
@ -172,7 +172,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
$noWriteService = new NoWriteWatchedItemStore( $innerService );
|
||||
|
||||
$return = $noWriteService->loadWatchedItem(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
new TitleValue( 0, 'Foo' )
|
||||
);
|
||||
$this->assertEquals( __METHOD__, $return );
|
||||
|
|
@ -187,7 +187,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
$noWriteService = new NoWriteWatchedItemStore( $innerService );
|
||||
|
||||
$return = $noWriteService->getWatchedItemsForUser(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
[]
|
||||
);
|
||||
$this->assertEquals( __METHOD__, $return );
|
||||
|
|
@ -200,7 +200,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
$noWriteService = new NoWriteWatchedItemStore( $innerService );
|
||||
|
||||
$return = $noWriteService->isWatched(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
new TitleValue( 0, 'Foo' )
|
||||
);
|
||||
$this->assertEquals( __METHOD__, $return );
|
||||
|
|
@ -215,7 +215,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
$noWriteService = new NoWriteWatchedItemStore( $innerService );
|
||||
|
||||
$return = $noWriteService->getNotificationTimestampsBatch(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
[ new TitleValue( 0, 'Foo' ) ]
|
||||
);
|
||||
$this->assertEquals( __METHOD__, $return );
|
||||
|
|
@ -230,7 +230,7 @@ class NoWriteWatchedItemStoreUnitTest extends \MediaWikiUnitTestCase {
|
|||
$noWriteService = new NoWriteWatchedItemStore( $innerService );
|
||||
|
||||
$return = $noWriteService->countUnreadNotifications(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
88
|
||||
);
|
||||
$this->assertEquals( __METHOD__, $return );
|
||||
|
|
|
|||
|
|
@ -1648,7 +1648,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiUnitTestCase {
|
|||
$queryService = $this->newService( $mockDb );
|
||||
|
||||
$items = $queryService->getWatchedItemsForUser(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ) );
|
||||
new UserIdentityValue( 0, 'AnonUser' ) );
|
||||
$this->assertSame( [], $items );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testClearWatchedItems() {
|
||||
$user = new UserIdentityValue( 7, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 7, 'MockUser' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
$mockDb->expects( $this->once() )
|
||||
|
|
@ -365,7 +365,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testClearWatchedItems_watchlistExpiry() {
|
||||
$user = new UserIdentityValue( 7, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 7, 'MockUser' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
// Select watchlist IDs.
|
||||
|
|
@ -404,7 +404,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testClearWatchedItems_tooManyItemsWatched() {
|
||||
$user = new UserIdentityValue( 7, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 7, 'MockUser' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
$mockDb->expects( $this->once() )
|
||||
|
|
@ -433,7 +433,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testCountWatchedItems() {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
$mockDb->expects( $this->once() )
|
||||
|
|
@ -954,7 +954,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testCountUnreadNotifications() {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
$mockDb->expects( $this->exactly( 1 ) )
|
||||
|
|
@ -984,7 +984,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideIntWithDbUnsafeVersion
|
||||
*/
|
||||
public function testCountUnreadNotifications_withUnreadLimit_overLimit( $limit ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
$mockDb->expects( $this->exactly( 1 ) )
|
||||
|
|
@ -1018,7 +1018,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideIntWithDbUnsafeVersion
|
||||
*/
|
||||
public function testCountUnreadNotifications_withUnreadLimit_underLimit( $limit ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
$mockDb->expects( $this->exactly( 1 ) )
|
||||
|
|
@ -1302,7 +1302,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$store = $this->newWatchedItemStore( [ 'db' => $mockDb, 'cache' => $mockCache ] );
|
||||
|
||||
$store->addWatch(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'Some_Page' )
|
||||
);
|
||||
}
|
||||
|
|
@ -1322,7 +1322,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$store = $this->newWatchedItemStore( [ 'db' => $mockDb, 'cache' => $mockCache ] );
|
||||
|
||||
$store->addWatch(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ),
|
||||
new UserIdentityValue( 0, 'AnonUser' ),
|
||||
$testPageFactory( 100, 0, 'Some_Page' )
|
||||
);
|
||||
}
|
||||
|
|
@ -1336,7 +1336,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->addWatchBatchForUser(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
[ $testPageFactory( 100, 0, 'Some_Page' ), $testPageFactory( 101, 1, 'Some_Page' ) ]
|
||||
)
|
||||
);
|
||||
|
|
@ -1383,7 +1383,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$store = $this->newWatchedItemStore( [ 'db' => $mockDb, 'cache' => $mockCache ] );
|
||||
|
||||
$mockUser = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$mockUser = new UserIdentityValue( 1, 'MockUser' );
|
||||
|
||||
$this->assertTrue(
|
||||
$store->addWatchBatchForUser(
|
||||
|
|
@ -1409,14 +1409,14 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->addWatchBatchForUser(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ),
|
||||
new UserIdentityValue( 0, 'AnonUser' ),
|
||||
[ $testPageFactory( 100, 0, 'Other_Page' ) ]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testAddWatchBatchReturnsTrue_whenGivenEmptyList() {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$mockDb = $this->getMockDb();
|
||||
$mockDb->expects( $this->never() )
|
||||
->method( 'insert' );
|
||||
|
|
@ -1474,7 +1474,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$store = $this->newWatchedItemStore( [ 'db' => $mockDb, 'cache' => $mockCache ] );
|
||||
|
||||
$watchedItem = $store->loadWatchedItem(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
);
|
||||
$this->assertInstanceOf( WatchedItem::class, $watchedItem );
|
||||
|
|
@ -1504,7 +1504,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->loadWatchedItem(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -1526,7 +1526,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->loadWatchedItem(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ),
|
||||
new UserIdentityValue( 0, 'AnonUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -1569,7 +1569,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertTrue(
|
||||
$store->removeWatch(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -1601,7 +1601,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->removeWatch(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -1624,7 +1624,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->removeWatch(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ),
|
||||
new UserIdentityValue( 0, 'AnonUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -1679,7 +1679,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$store = $this->newWatchedItemStore( [ 'db' => $mockDb, 'cache' => $mockCache ] );
|
||||
|
||||
$watchedItem = $store->getWatchedItem(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
);
|
||||
$this->assertInstanceOf( WatchedItem::class, $watchedItem );
|
||||
|
|
@ -1697,7 +1697,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$mockDb->expects( $this->never() )
|
||||
->method( 'selectRow' );
|
||||
|
||||
$mockUser = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$mockUser = new UserIdentityValue( 1, 'MockUser' );
|
||||
$linkTarget = $testPageFactory( 100, 0, 'SomeDbKey' );
|
||||
$cachedItem = new WatchedItem( $mockUser, $linkTarget, '20151212010101' );
|
||||
|
||||
|
|
@ -1759,7 +1759,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->getWatchedItem(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -1782,7 +1782,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->getWatchedItem(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ),
|
||||
new UserIdentityValue( 0, 'AnonUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -1820,7 +1820,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$mockCache->expects( $this->never() )->method( 'set' );
|
||||
|
||||
$store = $this->newWatchedItemStore( [ 'db' => $mockDb, 'cache' => $mockCache ] );
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
|
||||
$watchedItems = $store->getWatchedItemsForUser( $user );
|
||||
|
||||
|
|
@ -1858,7 +1858,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$mockDb = $this->getMockDb();
|
||||
$mockCache = $this->getMockCache();
|
||||
$mockLoadBalancer = $this->getMockLBFactory( $mockDb, $dbType );
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
|
||||
$mockDb->expects( $this->once() )
|
||||
->method( 'addQuotes' )
|
||||
|
|
@ -1928,7 +1928,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$mockCache->expects( $this->never() )->method( 'set' );
|
||||
|
||||
$store = $this->newWatchedItemStore( [ 'db' => $mockDb, 'cache' => $mockCache ] );
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
|
||||
$watchedItems = $store->getWatchedItemsForUser(
|
||||
$user,
|
||||
|
|
@ -1960,7 +1960,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
$store->getWatchedItemsForUser(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
[ 'sort' => 'foo' ]
|
||||
);
|
||||
}
|
||||
|
|
@ -2012,7 +2012,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertTrue(
|
||||
$store->isWatched(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -2055,7 +2055,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->isWatched(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -2078,7 +2078,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->isWatched(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ),
|
||||
new UserIdentityValue( 0, 'AnonUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -2147,7 +2147,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
1 => [ 'AnotherDbKey' => null, ],
|
||||
],
|
||||
$store->getNotificationTimestampsBatch(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ), $targets )
|
||||
new UserIdentityValue( 1, 'MockUser' ), $targets )
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -2197,7 +2197,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
0 => [ 'OtherDbKey' => false, ],
|
||||
],
|
||||
$store->getNotificationTimestampsBatch(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ), $targets )
|
||||
new UserIdentityValue( 1, 'MockUser' ), $targets )
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -2210,7 +2210,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$testPageFactory( 101, 1, 'AnotherDbKey' ),
|
||||
];
|
||||
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$cachedItem = new WatchedItem( $user, $targets[0], '20151212010101' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
|
|
@ -2270,7 +2270,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$testPageFactory( 101, 1, 'AnotherDbKey' ),
|
||||
];
|
||||
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$cachedItems = [
|
||||
new WatchedItem( $user, $targets[0], '20151212010101' ),
|
||||
new WatchedItem( $user, $targets[1], null ),
|
||||
|
|
@ -2321,7 +2321,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
1 => [ 'AnotherDbKey' => false, ],
|
||||
],
|
||||
$store->getNotificationTimestampsBatch(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ), $targets )
|
||||
new UserIdentityValue( 0, 'AnonUser' ), $targets )
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -2342,7 +2342,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
|
||||
$this->assertFalse(
|
||||
$store->resetNotificationTimestamp(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ),
|
||||
new UserIdentityValue( 0, 'AnonUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' )
|
||||
)
|
||||
);
|
||||
|
|
@ -2378,7 +2378,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$mockCache->expects( $this->never() )->method( 'set' );
|
||||
$mockCache->expects( $this->never() )->method( 'delete' );
|
||||
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$userFactory = $this->getUserFactory(
|
||||
[ $this->getMockUser( $user ) ]
|
||||
);
|
||||
|
|
@ -2405,7 +2405,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testResetNotificationTimestamp_item( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$title = $testPageFactory( 100, 0, 'SomeDbKey' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
|
|
@ -2491,7 +2491,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testResetNotificationTimestamp_noItemForced( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$title = $testPageFactory( 100, 0, 'SomeDbKey' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
|
|
@ -2575,7 +2575,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testResetNotificationTimestamp_oldidSpecifiedLatestRevisionForced( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$oldid = 22;
|
||||
$title = $testPageFactory( 100, 0, 'SomeTitle' );
|
||||
|
||||
|
|
@ -2656,7 +2656,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testResetNotificationTimestamp_oldidSpecifiedNotLatestRevisionForced( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$oldid = 22;
|
||||
$title = $testPageFactory( 100, 0, 'SomeDbKey' );
|
||||
|
||||
|
|
@ -2767,7 +2767,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testResetNotificationTimestamp_notWatchedPageForced( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$oldid = 22;
|
||||
$title = $testPageFactory( 100, 0, 'SomeDbKey' );
|
||||
|
||||
|
|
@ -2870,7 +2870,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testResetNotificationTimestamp_futureNotificationTimestampForced( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$oldid = 22;
|
||||
$title = $testPageFactory( 100, 0, 'SomeDbKey' );
|
||||
|
||||
|
|
@ -2981,7 +2981,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testResetNotificationTimestamp_futureNotificationTimestampNotForced( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$oldid = 22;
|
||||
$title = $testPageFactory( 100, 0, 'SomeDbKey' );
|
||||
|
||||
|
|
@ -3091,11 +3091,11 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
public function testSetNotificationTimestampsForUser_anonUser() {
|
||||
$store = $this->newWatchedItemStore();
|
||||
$this->assertFalse( $store->setNotificationTimestampsForUser(
|
||||
new UserIdentityValue( 0, 'AnonUser', 0 ), '' ) );
|
||||
new UserIdentityValue( 0, 'AnonUser' ), '' ) );
|
||||
}
|
||||
|
||||
public function testSetNotificationTimestampsForUser_allRows() {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$timestamp = '20100101010101';
|
||||
|
||||
$store = $this->newWatchedItemStore();
|
||||
|
|
@ -3115,7 +3115,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testSetNotificationTimestampsForUser_nullTimestamp() {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$timestamp = null;
|
||||
|
||||
$store = $this->newWatchedItemStore();
|
||||
|
|
@ -3137,7 +3137,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testSetNotificationTimestampsForUser_specificTargets( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$timestamp = '20100101010101';
|
||||
$targets = [ $testPageFactory( 100, 0, 'Foo' ), $testPageFactory( 101, 0, 'Bar' ) ];
|
||||
|
||||
|
|
@ -3221,7 +3221,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$this->assertEquals(
|
||||
[ 2, 3 ],
|
||||
$store->updateNotificationTimestamp(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' ),
|
||||
'20151212010101'
|
||||
)
|
||||
|
|
@ -3266,7 +3266,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$store = $this->newWatchedItemStore( [ 'db' => $mockDb, 'cache' => $mockCache ] );
|
||||
|
||||
$watchers = $store->updateNotificationTimestamp(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$testPageFactory( 100, 0, 'SomeDbKey' ),
|
||||
'20151212010101'
|
||||
);
|
||||
|
|
@ -3277,7 +3277,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
* @dataProvider provideTestPageFactory
|
||||
*/
|
||||
public function testUpdateNotificationTimestamp_clearsCachedItems( $testPageFactory ) {
|
||||
$user = new UserIdentityValue( 1, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 1, 'MockUser' );
|
||||
$titleValue = $testPageFactory( 100, 0, 'SomeDbKey' );
|
||||
|
||||
$mockDb = $this->getMockDb();
|
||||
|
|
@ -3326,7 +3326,7 @@ class WatchedItemStoreUnitTest extends MediaWikiUnitTestCase {
|
|||
$scopedOverride = $store->overrideDeferredUpdatesAddCallableUpdateCallback( $mockCallback );
|
||||
|
||||
$store->updateNotificationTimestamp(
|
||||
new UserIdentityValue( 1, 'MockUser', 0 ),
|
||||
new UserIdentityValue( 1, 'MockUser' ),
|
||||
$titleValue,
|
||||
'20151212010101'
|
||||
);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use Wikimedia\Timestamp\ConvertibleTimestamp;
|
|||
class WatchedItemUnitTest extends MediaWikiUnitTestCase {
|
||||
|
||||
public function testIsExpired() {
|
||||
$user = new UserIdentityValue( 7, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 7, 'MockUser' );
|
||||
$target = new TitleValue( 0, 'SomeDbKey' );
|
||||
|
||||
$notExpired1 = new WatchedItem( $user, $target, null, '20500101000000' );
|
||||
|
|
@ -23,7 +23,7 @@ class WatchedItemUnitTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testgetExpiryInDays() {
|
||||
$user = new UserIdentityValue( 7, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 7, 'MockUser' );
|
||||
$target = new TitleValue( 0, 'SomeDbKey' );
|
||||
|
||||
// Fake current time to be 2020-05-27T00:00:00Z
|
||||
|
|
@ -56,7 +56,7 @@ class WatchedItemUnitTest extends MediaWikiUnitTestCase {
|
|||
}
|
||||
|
||||
public function testgetExpiryInDaysText() {
|
||||
$user = new UserIdentityValue( 7, 'MockUser', 0 );
|
||||
$user = new UserIdentityValue( 7, 'MockUser' );
|
||||
$target = new TitleValue( 0, 'SomeDbKey' );
|
||||
|
||||
$messageLocalizer = $this->createMock( MessageLocalizer::class );
|
||||
|
|
|
|||
Loading…
Reference in a new issue