17 for ( $i = 1; $i <= 4; $i++ ) {
21 $sysop = static::getTestSysop()->getUser();
24 'address' => $this->localUsers[2]->getName(),
25 'by' => $sysop->getId(),
26 'reason' => __METHOD__,
33 'address' => $this->localUsers[3]->getName(),
34 'by' => $sysop->getId(),
35 'reason' => __METHOD__,
43 return static::getTestUser( [
'local-id-lookup-test' ] )->getUser();
52 $this->assertTrue( $user1->isAllowed(
'hideuser' ),
'sanity check' );
53 $this->assertFalse( $user2->isAllowed(
'hideuser' ),
'sanity check' );
55 $this->assertSame( [], $lookup->lookupCentralIds( [] ) );
58 foreach ( $this->localUsers
as $localUser ) {
59 $expect[$localUser->getId()] = $localUser->getName();
65 $expect2[$this->localUsers[3]->getId()] =
'';
67 $arg = array_fill_keys( array_keys( $expect ),
'X' );
69 $this->assertSame( $expect2, $lookup->lookupCentralIds( $arg ) );
71 $this->assertSame( $expect, $lookup->lookupCentralIds( $arg, $user1 ) );
72 $this->assertSame( $expect2, $lookup->lookupCentralIds( $arg, $user2 ) );
80 $this->assertTrue( $user1->isAllowed(
'hideuser' ),
'sanity check' );
81 $this->assertFalse( $user2->isAllowed(
'hideuser' ),
'sanity check' );
83 $this->assertSame( [], $lookup->lookupUserNames( [] ) );
86 foreach ( $this->localUsers
as $localUser ) {
87 $expect[$localUser->getName()] = $localUser->getId();
89 $expect[
'UTDoesNotExist'] =
'X';
93 $expect2[$this->localUsers[3]->getName()] =
'X';
95 $arg = array_fill_keys( array_keys( $expect ),
'X' );
97 $this->assertSame( $expect2, $lookup->lookupUserNames( $arg ) );
99 $this->assertSame( $expect, $lookup->lookupUserNames( $arg, $user1 ) );
100 $this->assertSame( $expect2, $lookup->lookupUserNames( $arg, $user2 ) );
108 $this->assertTrue( $lookup->isAttached( $user1 ) );
109 $this->assertFalse( $lookup->isAttached( $user2 ) );
112 $this->assertTrue( $lookup->isAttached( $user1, $wiki ) );
113 $this->assertFalse( $lookup->isAttached( $user2, $wiki ) );
116 $this->assertFalse( $lookup->isAttached( $user1, $wiki ) );
117 $this->assertFalse( $lookup->isAttached( $user2, $wiki ) );
129 'wgSharedDB' => $sharedDB ? $wgDBName :
null,
130 'wgSharedTables' => $sharedTable ? [
'user' ] : [],
131 'wgLocalDatabases' => $localDBSet ? [
'shared' ] : [],
136 $sharedDB && $sharedTable && $localDBSet,
137 $lookup->isAttached( $this->getLookupUser(),
'shared' )
143 for ( $i = 0; $i < 7; $i++ ) {