protected function tearDown()
 {
     $this->test_wrapper->destroyManuscriptsTest();
     unset($this->test_wrapper);
     unset($this->t);
     parent::tearDown();
 }
 protected function setUp()
 {
     global $wgFileBackends;
     parent::setUp();
     $tmpPrefix = wfTempDir() . '/filebackend-unittest-' . time() . '-' . mt_rand();
     if ($this->getCliArg('use-filebackend=')) {
         if (self::$backendToUse) {
             $this->singleBackend = self::$backendToUse;
         } else {
             $name = $this->getCliArg('use-filebackend=');
             $useConfig = array();
             foreach ($wgFileBackends as $conf) {
                 if ($conf['name'] == $name) {
                     $useConfig = $conf;
                     break;
                 }
             }
             $useConfig['name'] = 'localtesting';
             // swap name
             $useConfig['shardViaHashLevels'] = array('unittest-cont1' => array('levels' => 1, 'base' => 16, 'repeat' => 1));
             $class = $useConfig['class'];
             self::$backendToUse = new $class($useConfig);
             $this->singleBackend = self::$backendToUse;
         }
     } else {
         $this->singleBackend = new FSFileBackend(array('name' => 'localtesting', 'lockManager' => 'fsLockManager', 'containerPaths' => array('unittest-cont1' => "{$tmpPrefix}-localtesting-cont1", 'unittest-cont2' => "{$tmpPrefix}-localtesting-cont2")));
     }
     $this->multiBackend = new FileBackendMultiWrite(array('name' => 'localtesting', 'lockManager' => 'fsLockManager', 'parallelize' => 'implicit', 'backends' => array(array('name' => 'localmultitesting1', 'class' => 'FSFileBackend', 'lockManager' => 'nullLockManager', 'containerPaths' => array('unittest-cont1' => "{$tmpPrefix}-localtestingmulti1-cont1", 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti1-cont2"), 'isMultiMaster' => false), array('name' => 'localmultitesting2', 'class' => 'FSFileBackend', 'lockManager' => 'nullLockManager', 'containerPaths' => array('unittest-cont1' => "{$tmpPrefix}-localtestingmulti2-cont1", 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti2-cont2"), 'isMultiMaster' => true))));
     $this->filesToPrune = array();
 }
 function setUp()
 {
     global $wgHooks;
     parent::setUp();
     Hooks::clear('MediaWikiHooksTest001');
     unset($wgHooks['MediaWikiHooksTest001']);
 }
Exemple #4
0
 protected function setUp()
 {
     global $wgFileBackends;
     parent::setUp();
     $uniqueId = time() . '-' . mt_rand();
     $tmpDir = $this->getNewTempDirectory();
     if ($this->getCliArg('use-filebackend')) {
         if (self::$backendToUse) {
             $this->singleBackend = self::$backendToUse;
         } else {
             $name = $this->getCliArg('use-filebackend');
             $useConfig = array();
             foreach ($wgFileBackends as $conf) {
                 if ($conf['name'] == $name) {
                     $useConfig = $conf;
                     break;
                 }
             }
             $useConfig['name'] = 'localtesting';
             // swap name
             $useConfig['shardViaHashLevels'] = array('unittest-cont1' => array('levels' => 1, 'base' => 16, 'repeat' => 1));
             if (isset($useConfig['fileJournal'])) {
                 $useConfig['fileJournal'] = FileJournal::factory($useConfig['fileJournal'], $name);
             }
             $useConfig['lockManager'] = LockManagerGroup::singleton()->get($useConfig['lockManager']);
             $class = $useConfig['class'];
             self::$backendToUse = new $class($useConfig);
             $this->singleBackend = self::$backendToUse;
         }
     } else {
         $this->singleBackend = new FSFileBackend(array('name' => 'localtesting', 'lockManager' => LockManagerGroup::singleton()->get('fsLockManager'), 'wikiId' => wfWikiID(), 'containerPaths' => array('unittest-cont1' => "{$tmpDir}/localtesting-cont1", 'unittest-cont2' => "{$tmpDir}/localtesting-cont2")));
     }
     $this->multiBackend = new FileBackendMultiWrite(array('name' => 'localtesting', 'lockManager' => LockManagerGroup::singleton()->get('fsLockManager'), 'parallelize' => 'implicit', 'wikiId' => wfWikiId() . $uniqueId, 'backends' => array(array('name' => 'localmultitesting1', 'class' => 'FSFileBackend', 'containerPaths' => array('unittest-cont1' => "{$tmpDir}/localtestingmulti1-cont1", 'unittest-cont2' => "{$tmpDir}/localtestingmulti1-cont2"), 'isMultiMaster' => false), array('name' => 'localmultitesting2', 'class' => 'FSFileBackend', 'containerPaths' => array('unittest-cont1' => "{$tmpDir}/localtestingmulti2-cont1", 'unittest-cont2' => "{$tmpDir}/localtestingmulti2-cont2"), 'isMultiMaster' => true))));
 }
 protected function tearDown()
 {
     $this->database_test_instance_creator->destroyManuscriptsTest();
     unset($this->database_test_instance_creator);
     unset($this->t);
     parent::tearDown();
 }
Exemple #6
0
 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals('wgShowEXIF', true);
     $this->filePath = __DIR__ . '/../../data/media/';
     $this->handler = new TiffHandler();
 }
 protected function setUp()
 {
     parent::setUp();
     $group = MessageGroupBase::factory($this->groupConfiguration);
     /** @var YamlFFS $ffs */
     $this->ffs = $group->getFFS();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->cache1 = new HashBagOStuff();
     $this->cache2 = new HashBagOStuff();
     $this->cache = new MultiWriteBagOStuff(array('caches' => array($this->cache1, $this->cache2), 'replication' => 'async'));
 }
 function setUp()
 {
     parent::setUp();
     require_once __DIR__ . '/../data/helpers/WellProtectedClass.php';
     $this->raw = new WellProtectedClass();
     $this->wrapped = TestingAccessWrapper::newFromObject($this->raw);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->writeCache = new HashBagOStuff();
     $this->readCache = new HashBagOStuff();
     $this->cache = new ReplicatedBagOStuff(array('writeFactory' => $this->writeCache, 'readFactory' => $this->readCache));
 }
Exemple #11
0
 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals(['wgAllowUserJs' => false, 'wgDefaultLanguageVariant' => false, 'wgMetaNamespace' => 'Project']);
     $this->setUserLang('en');
     $this->setContentLang('en');
 }
Exemple #12
0
 protected function setUp()
 {
     parent::setUp();
     if (!CdbReader::haveExtension()) {
         $this->markTestSkipped('Native CDB support is not available');
     }
 }
 public function tearDown()
 {
     global $wgShowEXIF, $wgEnableAutoRotation;
     $wgShowEXIF = $this->show;
     $wgEnableAutoRotation = $this->oldAuto;
     parent::tearDown();
 }
 public function tearDown()
 {
     // turn off caching again.
     global $wgMainCacheType;
     $wgMainCacheType = $this->oldcache;
     parent::tearDown();
 }
 protected function setUp()
 {
     global $wgGroupPermissions;
     parent::setUp();
     $this->stashMwGlobals(['wgGroupPermissions']);
     $wgGroupPermissions['local-id-lookup-test']['hideuser'] = true;
 }
 protected function tearDown()
 {
     unset($this->t);
     unset($this->context);
     parent::tearDown();
     return;
 }
 public static function tearDownAfterClass()
 {
     parent::tearDownAfterClass();
     foreach (self::$startGlobals as $key => $value) {
         unset($GLOBALS[$key]);
     }
 }
 protected function setUp()
 {
     if ($this->willSkipTests()) {
         $this->markTestSkipped('GeoData extension is required.');
     }
     parent::setUp();
 }
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $this->tablesUsed[] = 'page';
     $this->tablesUsed[] = 'revision';
     $this->tablesUsed[] = 'pagelinks';
 }
Exemple #20
0
 protected function setUp()
 {
     parent::setUp();
     $this->checkPHPExtension('exif');
     $this->mediaPath = __DIR__ . '/../../data/media/';
     $this->setMwGlobals('wgShowEXIF', true);
 }
 function run(PHPUnit_Framework_TestResult $result = NULL)
 {
     /* Some functions require some kind of caching, and will end up using the db,
      * which we can't allow, as that would open a new connection for mysql.
      * Replace with a HashBag. They would not be going to persist anyway.
      */
     ObjectCache::$instances[CACHE_DB] = new HashBagOStuff();
     if ($this->needsDB()) {
         global $wgDBprefix;
         $this->useTemporaryTables = !$this->getCliArg('use-normal-tables');
         $this->reuseDB = $this->getCliArg('reuse-db');
         $this->db = wfGetDB(DB_MASTER);
         $this->checkDbIsSupported();
         $this->oldTablePrefix = $wgDBprefix;
         if (!self::$dbSetup) {
             $this->initDB();
             self::$dbSetup = true;
         }
         $this->addCoreDBData();
         $this->addDBData();
         parent::run($result);
         $this->resetDB();
     } else {
         parent::run($result);
     }
 }
Exemple #22
0
 protected function setUp()
 {
     parent::setUp();
     if (!wfDl('xml')) {
         $this->markTestSkipped('Requires libxml to do XMP parsing');
     }
 }
Exemple #23
0
 protected function setUp()
 {
     parent::setUp();
     $dbw = wfGetDB(DB_MASTER);
     $dbw->replace('interwiki', array('iw_prefix'), array('iw_prefix' => 'linksupdatetest', 'iw_url' => 'http://testing.com/wiki/$1', 'iw_api' => 'http://testing.com/w/api.php', 'iw_local' => 0, 'iw_trans' => 0, 'iw_wikiid' => 'linksupdatetest'));
     $this->setMwGlobals('wgRCWatchCategoryMembership', true);
 }
 public function setUp()
 {
     parent::setUp();
     global $IP;
     $this->json = "{$IP}/tests/phpunit/data/composer/composer.json";
     $this->json2 = "{$IP}/tests/phpunit/data/composer/new-composer.json";
 }
 protected function setUp()
 {
     parent::setUp();
     $readOnlyFile = $this->getNewTempFile();
     unlink($readOnlyFile);
     $this->setMwGlobals(array('wgReadOnlyFile' => $readOnlyFile, 'wgUrlProtocols' => array('http://', 'https://', 'mailto:', '//', 'file://')));
 }
 protected function setUp()
 {
     parent::setUp();
     if (!MWTidy::isEnabled()) {
         $this->markTestSkipped('Tidy not found');
     }
 }
Exemple #27
0
 protected function setUp()
 {
     parent::setUp();
     $langObj = Language::factory('en');
     $langObj->setNamespaces(array(-2 => 'Media', -1 => 'Special', 0 => '', 1 => 'Talk', 2 => 'User', 3 => 'User_talk', 4 => 'MyWiki', 5 => 'MyWiki_Talk', 6 => 'File', 7 => 'File_talk', 8 => 'MediaWiki', 9 => 'MediaWiki_talk', 10 => 'Template', 11 => 'Template_talk', 100 => 'Custom', 101 => 'Custom_talk'));
     $this->setMwGlobals(array('wgLang' => $langObj, 'wgWellFormedXml' => true));
 }
 protected function setUp()
 {
     parent::setUp();
     $this->cache1 = new HashBagOStuff();
     $this->cache2 = new HashBagOStuff();
     $this->cache = new MultiWriteBagOStuff(['caches' => [$this->cache1, $this->cache2], 'replication' => 'async', 'asyncHandler' => 'DeferredUpdates::addCallableUpdate']);
 }
 protected function setUp()
 {
     parent::setUp();
     $router = new PathRouter();
     $router->add("/wiki/\$1");
     $this->basicRouter = $router;
 }
 protected function setUp()
 {
     parent::setUp();
     $this->checkPHPExtension('exif');
     $this->setMwGlobals('wgShowEXIF', true);
     $this->handler = new ExifBitmapHandler();
 }