コード例 #1
0
 /**
  * @dataProvider provideIsAttachedShared
  * @param bool $sharedDB $wgSharedDB is set
  * @param bool $sharedTable $wgSharedTables contains 'user'
  * @param bool $localDBSet $wgLocalDatabases contains the shared DB
  */
 public function testIsAttachedShared($sharedDB, $sharedTable, $localDBSet)
 {
     global $wgDBName;
     $this->setMwGlobals(['wgSharedDB' => $sharedDB ? $wgDBName : null, 'wgSharedTables' => $sharedTable ? ['user'] : [], 'wgLocalDatabases' => $localDBSet ? ['shared'] : []]);
     $lookup = new LocalIdLookup();
     $this->assertSame($sharedDB && $sharedTable && $localDBSet, $lookup->isAttached($this->getLookupUser(), 'shared'));
 }
コード例 #2
0
 /**
  * @dataProvider provideIsAttachedShared
  * @param bool $sharedDB $wgSharedDB is set
  * @param bool $sharedTable $wgSharedTables contains 'user'
  * @param bool $localDBSet $wgLocalDatabases contains the shared DB
  */
 public function testIsAttachedShared($sharedDB, $sharedTable, $localDBSet)
 {
     global $wgDBName;
     $this->setMwGlobals(array('wgSharedDB' => $sharedDB ? $wgDBName : null, 'wgSharedTables' => $sharedTable ? array('user') : array(), 'wgLocalDatabases' => $localDBSet ? array('shared') : array()));
     $lookup = new LocalIdLookup();
     $this->assertSame($sharedDB && $sharedTable && $localDBSet, $lookup->isAttached(User::newFromName('UTLocalIdLookup1'), 'shared'));
 }