當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Settings::newFromArray方法代碼示例

本文整理匯總了PHP中SMW\Settings::newFromArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Settings::newFromArray方法的具體用法?PHP Settings::newFromArray怎麽用?PHP Settings::newFromArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SMW\Settings的用法示例。


在下文中一共展示了Settings::newFromArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = Settings::newFromArray(array('smwgShowFactbox' => SMW_FACTBOX_NONEMPTY, 'smwgFactboxUseCache' => true, 'smwgCacheType' => 'hash', 'smwgLinksInValues' => false, 'smwgInlineErrors' => true));
     $this->applicationFactory->registerObject('Settings', $settings);
 }
開發者ID:ReachingOut,項目名稱:SemanticMediaWiki,代碼行數:7,代碼來源:OutputPageParserOutputTest.php

示例2: testPropertyTablesWithValidCustomizableProperties

 /**
  * @depends testGetPropertyTables
  */
 public function testPropertyTablesWithValidCustomizableProperties()
 {
     $instance = $this->acquireInstance();
     $instance->setConfiguration(Settings::newFromArray(array('smwgFixedProperties' => array(), 'smwgPageSpecialProperties' => array('_MDAT', '_MEDIA'))));
     $this->assertCount($this->defaultPropertyTableCount + 2, $instance->getPropertyTables());
     $instance->clear();
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:10,代碼來源:SQLStoreTest.php

示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = Settings::newFromArray(array('smwgFactboxUseCache' => true, 'smwgCacheType' => 'hash'));
     $this->applicationFactory->registerObject('Settings', $settings);
 }
開發者ID:WolfgangFahl,項目名稱:SemanticMediaWiki,代碼行數:7,代碼來源:SkinAfterContentTest.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->skin = $this->getMockBuilder('\\Skin')->disableOriginalConstructor()->getMock();
     $this->settings = Settings::newFromArray(array());
     $this->dataItemFactory = new DataItemFactory();
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:8,代碼來源:WantedPropertiesQueryPageTest.php

示例5: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->skin = $this->getMockBuilder('\\Skin')->disableOriginalConstructor()->getMock();
     $this->settings = Settings::newFromArray(array('smwgPDefaultType' => '_wpg', 'smwgPropertyLowUsageThreshold' => 5, 'smwgPropertyZeroCountDisplay' => true));
     $this->dataItemFactory = new DataItemFactory();
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:8,代碼來源:PropertiesQueryPageTest.php

示例6: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = Settings::newFromArray(array('smwgFactboxUseCache' => true, 'smwgCacheType' => 'hash', 'smwgLinksInValues' => false, 'smwgInlineErrors' => true));
     $this->applicationFactory->registerObject('Settings', $settings);
     $this->cache = $this->applicationFactory->newCacheFactory()->newFixedInMemoryCache();
     $this->applicationFactory->registerObject('Cache', $this->cache);
 }
開發者ID:ReachingOut,項目名稱:SemanticMediaWiki,代碼行數:9,代碼來源:ArticlePurgeTest.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $settings = Settings::newFromArray(array('smwgCacheType' => 'hash', 'smwgEnableUpdateJobs' => false));
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->applicationFactory->registerObject('Store', $store);
     $this->applicationFactory->registerObject('Settings', $settings);
 }
開發者ID:ReachingOut,項目名稱:SemanticMediaWiki,代碼行數:9,代碼來源:UpdateJobTest.php

示例8: testProcess

 /**
  * @dataProvider skinTemplateDataProvider
  */
 public function testProcess($setup, $expected)
 {
     $toolbox = '';
     ApplicationFactory::getInstance()->registerObject('Settings', Settings::newFromArray($setup['settings']));
     $instance = new BaseTemplateToolbox($setup['skinTemplate'], $toolbox);
     $this->assertTrue($instance->process());
     if ($expected['count'] == 0) {
         return $this->assertEmpty($toolbox);
     }
     $this->assertCount($expected['count'], $toolbox['smw-browse']);
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:14,代碼來源:BaseTemplateToolboxTest.php

示例9: testProcess

 /**
  * @dataProvider wikiPageDataProvider
  */
 public function testProcess($parameters, $expected)
 {
     $this->applicationFactory->registerObject('Settings', Settings::newFromArray($parameters['settings']));
     $instance = new NewRevisionFromEditComplete($parameters['wikiPage'], $parameters['revision'], 0);
     $this->assertTrue($instance->process());
     $editInfo = $parameters['editInfo'];
     if ($editInfo && $editInfo->output instanceof ParserOutput) {
         $parserData = $this->applicationFactory->newParserData($parameters['wikiPage']->getTitle(), $editInfo->output);
         $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $parserData->getSemanticData());
     }
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:14,代碼來源:NewRevisionFromEditCompleteTest.php

示例10: testDeleteSubjectForNotSupportedSemanticNamespace

 public function testDeleteSubjectForNotSupportedSemanticNamespace()
 {
     $oldTitle = \Title::newFromText('Old');
     $newTitle = \Title::newFromText('New', NS_HELP);
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $store->expects($this->once())->method('deleteSubject')->with($this->equalTo($oldTitle));
     $this->applicationFactory->registerObject('Settings', Settings::newFromArray(array('smwgCacheType' => 'hash', 'smwgAutoRefreshOnPageMove' => true, 'smwgNamespacesWithSemanticLinks' => array(NS_MAIN => true, NS_HELP => false))));
     $this->applicationFactory->registerObject('Store', $store);
     $instance = new TitleMoveComplete($oldTitle, $newTitle, new MockSuperUser(), 0, 0);
     $this->assertTrue($instance->process());
 }
開發者ID:ReachingOut,項目名稱:SemanticMediaWiki,代碼行數:11,代碼來源:TitleMoveCompleteTest.php

示例11: testProcess

 public function testProcess()
 {
     $oldTitle = MockTitle::buildMock('old');
     $newTitle = MockTitle::buildMock('new');
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $store->expects($this->once())->method('changeTitle')->with($this->equalTo($oldTitle), $this->equalTo($newTitle), $this->anything(), $this->anything());
     $this->applicationFactory->registerObject('Settings', Settings::newFromArray(array('smwgCacheType' => 'hash', 'smwgAutoRefreshOnPageMove' => true)));
     $this->applicationFactory->registerObject('Store', $store);
     $instance = new TitleMoveComplete($oldTitle, $newTitle, new MockSuperUser(), 0, 0);
     $this->assertTrue($instance->process());
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:11,代碼來源:TitleMoveCompleteTest.php

示例12: testChainableDecoratorAnnotation

 /**
  * @dataProvider annotationDataProvider
  */
 public function testChainableDecoratorAnnotation(array $parameters, array $expected)
 {
     $pageInfoProvider = $this->getMockBuilder('\\SMW\\PageInfo')->disableOriginalConstructor()->getMock();
     $pageInfoProvider->expects($this->atLeastOnce())->method('getModificationDate')->will($this->returnValue($parameters['modificationDate']));
     $semanticData = $this->semanticDataFactory->newEmptySemanticData(__METHOD__);
     $this->applicationFactory->registerObject('Settings', Settings::newFromArray($parameters['settings']));
     $instance = new CategoryPropertyAnnotator(new NullPropertyAnnotator($semanticData), $parameters['categories']);
     $instance = new SortKeyPropertyAnnotator($instance, $parameters['sortkey']);
     $instance = new PredefinedPropertyAnnotator($instance, $pageInfoProvider);
     $instance->addAnnotation();
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $instance->getSemanticData());
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:15,代碼來源:ChainablePropertyAnnotatorTest.php

示例13: testTextChangeWithParserOuputUpdateIntegration

 /**
  * @dataProvider textDataProvider
  */
 public function testTextChangeWithParserOuputUpdateIntegration($parameters, $expected)
 {
     $text = $parameters['text'];
     $parser = $this->parserFactory->newFromTitle($parameters['title']);
     $instance = new InternalParseBeforeLinks($parser, $text);
     $this->applicationFactory->registerObject('Settings', Settings::newFromArray($parameters['settings']));
     $this->assertTrue($instance->process());
     $this->assertEquals($expected['resultText'], $text);
     $parserData = $this->applicationFactory->newParserData($parser->getTitle(), $parser->getOutput());
     $this->assertEquals($expected['propertyCount'] > 0, $parser->getOutput()->getProperty('smw-semanticdata-status'));
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $parserData->getSemanticData());
 }
開發者ID:Rikuforever,項目名稱:wiki,代碼行數:15,代碼來源:InternalParseBeforeLinksTest.php

示例14: testAddSpecialProperties

 /**
  * @dataProvider specialPropertiesDataProvider
  */
 public function testAddSpecialProperties(array $parameters, array $expected)
 {
     $semanticData = $this->semanticDataFactory->setSubject($parameters['subject'])->newEmptySemanticData();
     $pageInfo = $this->getMockBuilder('\\SMW\\PageInfo')->disableOriginalConstructor()->getMock();
     foreach ($parameters['pageInfo'] as $method => $returnValue) {
         $pageInfo->expects($this->any())->method($method)->will($this->returnValue($returnValue));
     }
     $this->applicationFactory->registerObject('Settings', Settings::newFromArray($parameters['settings']));
     $instance = new PredefinedPropertyAnnotator(new NullPropertyAnnotator($semanticData), $pageInfo);
     $instance->addAnnotation();
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $instance->getSemanticData());
 }
開發者ID:ReachingOut,項目名稱:SemanticMediaWiki,代碼行數:15,代碼來源:PredefinedPropertyAnnotatorTest.php

示例15: testAddCategoriesWithHiddenCategories

 /**
  * @dataProvider hiddenCategoriesDataProvider
  */
 public function testAddCategoriesWithHiddenCategories(array $parameters, array $expected)
 {
     $expectedPageLookup = $parameters['settings']['smwgShowHiddenCategories'] ? $this->never() : $this->atLeastOnce();
     $wikiPage = $this->getMockBuilder('\\WikiPage')->disableOriginalConstructor()->getMock();
     $wikiPage->expects($expectedPageLookup)->method('getHiddenCategories')->will($this->returnValue($parameters['hidCategories']));
     $pageCreator = $this->getMockBuilder('\\SMW\\MediaWiki\\PageCreator')->disableOriginalConstructor()->getMock();
     $pageCreator->expects($expectedPageLookup)->method('createPage')->will($this->returnValue($wikiPage));
     $semanticData = $this->semanticDataFactory->setSubject(new DIWikiPage(__METHOD__, $parameters['namespace'], ''))->newEmptySemanticData();
     $this->applicationFactory->registerObject('Settings', Settings::newFromArray($parameters['settings']));
     $this->applicationFactory->registerObject('PageCreator', $pageCreator);
     $instance = new CategoryPropertyAnnotator(new NullPropertyAnnotator($semanticData), $parameters['categories']);
     $instance->addAnnotation();
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $semanticData);
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:17,代碼來源:CategoryPropertyAnnotatorTest.php


注:本文中的SMW\Settings::newFromArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。