本文整理汇总了PHP中MediaWikiTestCase类的典型用法代码示例。如果您正苦于以下问题:PHP MediaWikiTestCase类的具体用法?PHP MediaWikiTestCase怎么用?PHP MediaWikiTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MediaWikiTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
protected function tearDown()
{
$this->test_wrapper->destroyManuscriptsTest();
unset($this->test_wrapper);
unset($this->t);
parent::tearDown();
}
示例2: setUp
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();
}
示例3: setUp
function setUp()
{
global $wgHooks;
parent::setUp();
Hooks::clear('MediaWikiHooksTest001');
unset($wgHooks['MediaWikiHooksTest001']);
}
示例4: setUp
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))));
}
示例5: tearDown
protected function tearDown()
{
$this->database_test_instance_creator->destroyManuscriptsTest();
unset($this->database_test_instance_creator);
unset($this->t);
parent::tearDown();
}
示例6: setUp
protected function setUp()
{
parent::setUp();
$this->setMwGlobals('wgShowEXIF', true);
$this->filePath = __DIR__ . '/../../data/media/';
$this->handler = new TiffHandler();
}
示例7: setUp
protected function setUp()
{
parent::setUp();
$group = MessageGroupBase::factory($this->groupConfiguration);
/** @var YamlFFS $ffs */
$this->ffs = $group->getFFS();
}
示例8: setUp
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'));
}
示例9: setUp
function setUp()
{
parent::setUp();
require_once __DIR__ . '/../data/helpers/WellProtectedClass.php';
$this->raw = new WellProtectedClass();
$this->wrapped = TestingAccessWrapper::newFromObject($this->raw);
}
示例10: setUp
protected function setUp()
{
parent::setUp();
$this->writeCache = new HashBagOStuff();
$this->readCache = new HashBagOStuff();
$this->cache = new ReplicatedBagOStuff(array('writeFactory' => $this->writeCache, 'readFactory' => $this->readCache));
}
示例11: setUp
protected function setUp()
{
parent::setUp();
$this->setMwGlobals(['wgAllowUserJs' => false, 'wgDefaultLanguageVariant' => false, 'wgMetaNamespace' => 'Project']);
$this->setUserLang('en');
$this->setContentLang('en');
}
示例12: setUp
protected function setUp()
{
parent::setUp();
if (!CdbReader::haveExtension()) {
$this->markTestSkipped('Native CDB support is not available');
}
}
示例13: tearDown
public function tearDown()
{
global $wgShowEXIF, $wgEnableAutoRotation;
$wgShowEXIF = $this->show;
$wgEnableAutoRotation = $this->oldAuto;
parent::tearDown();
}
示例14: tearDown
public function tearDown()
{
// turn off caching again.
global $wgMainCacheType;
$wgMainCacheType = $this->oldcache;
parent::tearDown();
}
示例15: setUp
protected function setUp()
{
global $wgGroupPermissions;
parent::setUp();
$this->stashMwGlobals(['wgGroupPermissions']);
$wgGroupPermissions['local-id-lookup-test']['hideuser'] = true;
}