当前位置: 首页>>代码示例>>PHP>>正文


PHP JobQueueGroup::destroySingletons方法代码示例

本文整理汇总了PHP中JobQueueGroup::destroySingletons方法的典型用法代码示例。如果您正苦于以下问题:PHP JobQueueGroup::destroySingletons方法的具体用法?PHP JobQueueGroup::destroySingletons怎么用?PHP JobQueueGroup::destroySingletons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JobQueueGroup的用法示例。


在下文中一共展示了JobQueueGroup::destroySingletons方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: runJobs

 private function runJobs()
 {
     JobQueueGroup::destroySingletons();
     $jobs = new RunJobs();
     $jobs->loadParamsAndArgs(null, ['quiet' => true], null);
     $jobs->execute();
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:7,代码来源:CategoryMembershipChangeJobTest.php

示例2: testTemplateCategories

 function testTemplateCategories()
 {
     $title = Title::newFromText("Categorized from template");
     $page = WikiPage::factory($title);
     $user = new User();
     $user->mRights = array('createpage', 'edit', 'purge');
     $page->doEditContent(new WikitextContent('{{Categorising template}}'), 'Create a page with a template', 0, false, $user);
     $this->assertEquals(array(), $title->getParentCategories());
     $template = WikiPage::factory(Title::newFromText('Template:Categorising template'));
     $template->doEditContent(new WikitextContent('[[Category:Solved bugs]]'), 'Add a category through a template', 0, false, $user);
     // Run the job queue
     JobQueueGroup::destroySingletons();
     $jobs = new RunJobs();
     $jobs->loadParamsAndArgs(null, array('quiet' => true), null);
     $jobs->execute();
     $this->assertEquals(array('Category:Solved_bugs' => $title->getPrefixedText()), $title->getParentCategories());
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:17,代码来源:TemplateCategoriesTest.php

示例3: testTemplateCategories

 /**
  * @covers Title::getParentCategories
  */
 public function testTemplateCategories()
 {
     $user = new User();
     $user->mRights = array('createpage', 'edit', 'purge', 'delete');
     $title = Title::newFromText("Categorized from template");
     $page = WikiPage::factory($title);
     $page->doEditContent(new WikitextContent('{{Categorising template}}'), 'Create a page with a template', 0, false, $user);
     $this->assertEquals(array(), $title->getParentCategories(), 'Verify that the category doesn\'t contain the page before the template is created');
     // Create template
     $template = WikiPage::factory(Title::newFromText('Template:Categorising template'));
     $template->doEditContent(new WikitextContent('[[Category:Solved bugs]]'), 'Add a category through a template', 0, false, $user);
     // Run the job queue
     JobQueueGroup::destroySingletons();
     $jobs = new RunJobs();
     $jobs->loadParamsAndArgs(null, array('quiet' => true), null);
     $jobs->execute();
     // Make sure page is in the category
     $this->assertEquals(array('Category:Solved_bugs' => $title->getPrefixedText()), $title->getParentCategories(), 'Verify that the page is in the category after the template is created');
     // Edit the template
     $template->doEditContent(new WikitextContent('[[Category:Solved bugs 2]]'), 'Change the category added by the template', 0, false, $user);
     // Run the job queue
     JobQueueGroup::destroySingletons();
     $jobs = new RunJobs();
     $jobs->loadParamsAndArgs(null, array('quiet' => true), null);
     $jobs->execute();
     // Make sure page is in the right category
     $this->assertEquals(array('Category:Solved_bugs_2' => $title->getPrefixedText()), $title->getParentCategories(), 'Verify that the page is in the right category after the template is edited');
     // Now delete the template
     $error = '';
     $template->doDeleteArticleReal('Delete the template', false, 0, true, $error, $user);
     // Run the job queue
     JobQueueGroup::destroySingletons();
     $jobs = new RunJobs();
     $jobs->loadParamsAndArgs(null, array('quiet' => true), null);
     $jobs->execute();
     // Make sure the page is no longer in the category
     $this->assertEquals(array(), $title->getParentCategories(), 'Verify that the page is no longer in the category after template deletion');
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:41,代码来源:TemplateCategoriesTest.php

示例4: prepareEnvironment

 protected function prepareEnvironment()
 {
     global $wgMemc;
     // Don't share DB, storage, or memcached connections
     MediaWikiServices::resetChildProcessServices();
     FileBackendGroup::destroySingleton();
     LockManagerGroup::destroySingletons();
     JobQueueGroup::destroySingletons();
     ObjectCache::clear();
     RedisConnectionPool::destroySingletons();
     $wgMemc = null;
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:12,代码来源:ForkController.php

示例5: testDoDeleteUpdates

 /**
  * @covers WikiPage::doDeleteUpdates
  */
 public function testDoDeleteUpdates()
 {
     $page = $this->createPage("WikiPageTest_testDoDeleteArticle", "[[original text]] foo", CONTENT_MODEL_WIKITEXT);
     $id = $page->getId();
     // Similar to MovePage logic
     wfGetDB(DB_MASTER)->delete('page', array('page_id' => $id), __METHOD__);
     $page->doDeleteUpdates($id);
     // Run the job queue
     JobQueueGroup::destroySingletons();
     $jobs = new RunJobs();
     $jobs->loadParamsAndArgs(null, array('quiet' => true), null);
     $jobs->execute();
     # ------------------------
     $dbr = wfGetDB(DB_SLAVE);
     $res = $dbr->select('pagelinks', '*', array('pl_from' => $id));
     $n = $res->numRows();
     $res->free();
     $this->assertEquals(0, $n, 'pagelinks should contain no more links from the page');
 }
开发者ID:T282,项目名称:mediawiki,代码行数:22,代码来源:WikiPageTest.php

示例6: prepareEnvironment

 protected function prepareEnvironment()
 {
     global $wgMemc;
     // Don't share DB, storage, or memcached connections
     wfGetLBFactory()->destroyInstance();
     FileBackendGroup::destroySingleton();
     LockManagerGroup::destroySingletons();
     JobQueueGroup::destroySingletons();
     ObjectCache::clear();
     RedisConnectionPool::destroySingletons();
     $wgMemc = null;
 }
开发者ID:mb720,项目名称:mediawiki,代码行数:12,代码来源:ForkController.php

示例7: doLightweightServiceReset

 /**
  * Resets some well known services that typically have state that may interfere with unit tests.
  * This is a lightweight alternative to resetGlobalServices().
  *
  * @note There is no guarantee that no references remain to stale service instances destroyed
  * by a call to doLightweightServiceReset().
  *
  * @throws MWException if called outside of PHPUnit tests.
  *
  * @see resetGlobalServices()
  */
 private function doLightweightServiceReset()
 {
     global $wgRequest;
     JobQueueGroup::destroySingletons();
     ObjectCache::clear();
     $services = MediaWikiServices::getInstance();
     $services->resetServiceForTesting('MainObjectStash');
     $services->resetServiceForTesting('LocalServerObjectCache');
     $services->getMainWANObjectCache()->clearProcessCache();
     FileBackendGroup::destroySingleton();
     // TODO: move global state into MediaWikiServices
     RequestContext::resetMain();
     if (session_id() !== '') {
         session_write_close();
         session_id('');
     }
     $wgRequest = new FauxRequest();
     MediaWiki\Session\SessionManager::resetCache();
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:30,代码来源:MediaWikiTestCase.php

示例8: doLightweightServiceReset

 /**
  * Resets some well known services that typically have state that may interfere with unit tests.
  * This is a lightweight alternative to resetGlobalServices().
  *
  * @note There is no guarantee that no references remain to stale service instances destroyed
  * by a call to doLightweightServiceReset().
  *
  * @throws MWException if called outside of PHPUnit tests.
  *
  * @see resetGlobalServices()
  */
 private function doLightweightServiceReset()
 {
     global $wgRequest;
     JobQueueGroup::destroySingletons();
     ObjectCache::clear();
     FileBackendGroup::destroySingleton();
     // TODO: move global state into MediaWikiServices
     RequestContext::resetMain();
     MediaHandler::resetCache();
     if (session_id() !== '') {
         session_write_close();
         session_id('');
     }
     $wgRequest = new FauxRequest();
     MediaWiki\Session\SessionManager::resetCache();
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:27,代码来源:MediaWikiTestCase.php


注:本文中的JobQueueGroup::destroySingletons方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。