示例#1
0
 public function setUp()
 {
     parent::setUp();
     $conf = new SiteConfiguration();
     $conf->settings = ['wgServer' => ['enwiki' => 'http://en.example.org', 'ruwiki' => '//ru.example.org'], 'wgArticlePath' => ['enwiki' => '/w/$1', 'ruwiki' => '/wiki/$1']];
     $conf->suffixes = ['wiki'];
     $this->setMwGlobals(['wgConf' => $conf]);
     TestSites::insertIntoDb();
 }
 public function setUp()
 {
     parent::setUp();
     static $hasSites = false;
     if (!$hasSites) {
         TestSites::insertIntoDb();
         $hasSites = true;
     }
 }
 /**
  * @covers DBSiteStore::getSites
  */
 public function testGetSites()
 {
     $expectedSites = TestSites::getSites();
     TestSites::insertIntoDb();
     $store = new DBSiteStore();
     $sites = $store->getSites();
     $this->assertInstanceOf('SiteList', $sites);
     /**
      * @var Site $site
      */
     foreach ($sites as $site) {
         $this->assertInstanceOf('Site', $site);
     }
     foreach ($expectedSites as $site) {
         if ($site->getGlobalId() !== null) {
             $this->assertTrue($sites->hasSite($site->getGlobalId()));
         }
     }
 }
示例#4
0
 public function setUp()
 {
     parent::setUp();
     TestSites::insertIntoDb();
 }