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


PHP DIWikiPage::newFromText方法代碼示例

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


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

示例1: subjectProvider

 public function subjectProvider()
 {
     $provider[] = array(DIWikiPage::newFromText('Foo'));
     $provider[] = array(DIWikiPage::newFromText('Bar', SMW_NS_PROPERTY));
     $provider[] = array(DIWikiPage::newFromText('Modification date', SMW_NS_PROPERTY));
     return $provider;
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:7,代碼來源:EntitySubobjectListIteratorTest.php

示例2: testErrorContainerForSamePropertyButDifferentMsg

 public function testErrorContainerForSamePropertyButDifferentMsg()
 {
     $instance = new Error(DIWikiPage::newFromText('Foo'));
     $property = new DIProperty('Foo');
     $container = $instance->getContainerFor($property, array('Some error'));
     $this->assertNotSame($container->getHash(), $instance->getContainerFor($property, array('Different error'))->getHash());
 }
開發者ID:WolfgangFahl,項目名稱:SemanticMediaWiki,代碼行數:7,代碼來源:ErrorTest.php

示例3: testGetHash

 public function testGetHash()
 {
     $diff = array();
     $instance = new CompositePropertyTableDiffIterator($diff);
     $instance->setSubject(DIWikiPage::newFromText(__METHOD__));
     $this->assertInternalType('string', $instance->getHash());
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:7,代碼來源:CompositePropertyTableDiffIteratorTest.php

示例4: testCreateProfile

 /**
  * @dataProvider durationDataProvider
  */
 public function testCreateProfile($duration, $expected)
 {
     $profiler = new NullProfileAnnotator(new Subobject(DIWikiPage::newFromText(__METHOD__)->getTitle()), 'foo');
     $instance = new DurationProfileAnnotator($profiler, $duration);
     $instance->addAnnotation();
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $instance->getContainer()->getSemanticData());
 }
開發者ID:WolfgangFahl,項目名稱:SemanticMediaWiki,代碼行數:10,代碼來源:DurationProfileAnnotatorTest.php

示例5: testRun

 public function testRun()
 {
     $parameters = array('slot:id' => 42);
     $this->transitionalDiffStore->expects($this->once())->method('delete');
     $subject = DIWikiPage::newFromText(__METHOD__);
     $instance = new ChronologyPurgeJob($subject->getTitle(), $parameters);
     $this->assertTrue($instance->run());
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:8,代碼來源:ChronologyPurgeJobTest.php

示例6: testCreateProfile

 public function testCreateProfile()
 {
     $profiler = new NullProfileAnnotator(new Subobject(DIWikiPage::newFromText(__METHOD__)->getTitle()), 'foo');
     $instance = new FormatProfileAnnotator($profiler, 'table');
     $instance->addAnnotation();
     $expected = array('propertyCount' => 1, 'propertyKeys' => array('_ASKFO'), 'propertyValues' => array('table'));
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $instance->getContainer()->getSemanticData());
 }
開發者ID:WolfgangFahl,項目名稱:SemanticMediaWiki,代碼行數:8,代碼來源:FormatProfileAnnotatorTest.php

示例7: testAddAnotherToEntityList

 /**
  * @depends testAddToEntityList
  */
 public function testAddAnotherToEntityList()
 {
     $dataItem = DIWikiPage::newFromText('Bar');
     $this->query->expects($this->any())->method('getQueryId')->will($this->returnValue('FOO:BAR'));
     $instance = new EntityListAccumulator($this->query);
     $instance->addToEntityList($dataItem);
     $this->assertEquals(array('FOO:BAR' => array('Bar#0#' => $dataItem)), $instance->getEntityList());
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:11,代碼來源:EntityListAccumulatorTest.php

示例8: dataItemDataProvider

 public function dataItemDataProvider()
 {
     // Single
     $subject = array(DIWikiPage::newFromText(__METHOD__));
     // Multiple
     $subjects = array(DIWikiPage::newFromText(__METHOD__ . 'm-0'), DIWikiPage::newFromText(__METHOD__ . 'm-1'), DIWikiPage::newFromText(__METHOD__ . 'm-2'));
     return array(array($subjects, array(), array('_PVAL', '_LIST'), array('diff' => true, 'job' => true)), array(array(), $subjects, array('_PVAL', '_LIST'), array('diff' => true, 'job' => true)), array($subject, $subjects, array('_PVAL', '_LIST'), array('diff' => true, 'job' => true)), array($subject, array(), array('_PVAL', '_LIST'), array('diff' => true, 'job' => true)), array($subject, array(), array('_PVAL'), array('diff' => true, 'job' => true)), array($subjects, $subjects, array('_PVAL'), array('diff' => false, 'job' => false)), array($subject, $subject, array('_PVAL'), array('diff' => false, 'job' => false)), array($subjects, $subjects, array('_PVAL', '_LIST'), array('diff' => true, 'job' => true)), array($subject, $subject, array('_PVAL', '_LIST'), array('diff' => true, 'job' => true)));
 }
開發者ID:FlorianSW,項目名稱:SemanticMediaWiki,代碼行數:8,代碼來源:PropertySpecificationChangeNotifierTest.php

示例9: testGetHash

 public function testGetHash()
 {
     $instance = new SemanticData(DIWikiPage::newFromText(__METHOD__));
     $instance->addDataValue(DataValueFactory::getInstance()->newDataValueByText('Has fooQuex', 'Bar'));
     $subobject = $this->newSubobject($instance->getSubject()->getTitle());
     $instance->addPropertyObjectValue($subobject->getProperty(), $subobject->getContainer());
     $this->assertInternalType('string', $instance->getHash());
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:8,代碼來源:SemanticDataTest.php

示例10: setUp

 protected function setUp()
 {
     parent::setUp();
     $idTable = $this->getMockBuilder('\\stdClass')->setMethods(array('getDataItemById'))->getMock();
     $idTable->expects($this->any())->method('getDataItemById')->will($this->returnValue(DIWikiPage::newFromText('Foo')));
     $this->store = $this->getMockBuilder('\\SMW\\SQLStore\\SQLStore')->disableOriginalConstructor()->getMock();
     $this->store->expects($this->any())->method('getObjectIds')->will($this->returnValue($idTable));
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:8,代碼來源:PropertyTableIdReferenceDisposerTest.php

示例11: testPreliminaryCheckForType

 /**
  * @dataProvider preliminaryCheckProvider
  */
 public function testPreliminaryCheckForType($type, $parameters = array())
 {
     $httpRequest = $this->getMockBuilder('\\Onoi\\HttpRequest\\SocketRequest')->disableOriginalConstructor()->getMock();
     $httpRequest->expects($this->any())->method('ping')->will($this->returnValue(true));
     $instance = new DeferredRequestDispatchManager($httpRequest);
     $instance->reset();
     $this->assertNull($instance->dispatchJobRequestFor($type, DIWikiPage::newFromText(__METHOD__)->getTitle(), $parameters));
 }
開發者ID:WolfgangFahl,項目名稱:SemanticMediaWiki,代碼行數:11,代碼來源:DeferredRequestDispatchManagerTest.php

示例12: testNoAnnotationWhenDisabled

 public function testNoAnnotationWhenDisabled()
 {
     $semanticData = $this->semanticDataFactory->newEmptySemanticData(DIWikiPage::newFromText('Foo'));
     $instance = new DisplayTitlePropertyAnnotator(new NullPropertyAnnotator($semanticData), 'Bar');
     $instance->canCreateAnnotation(false);
     $instance->addAnnotation();
     $expected = array('propertyCount' => 0);
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $instance->getSemanticData());
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:9,代碼來源:DisplayTitlePropertyAnnotatorTest.php

示例13: testDisabledSubcategoryLookup

 public function testDisabledSubcategoryLookup()
 {
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $cache = $this->getMockBuilder('\\Onoi\\Cache\\Cache')->disableOriginalConstructor()->getMock();
     $cache->expects($this->never())->method('contains')->will($this->returnValue(false));
     $instance = new PropertyHierarchyLookup($store, $cache);
     $instance->setSubcategoryDepth(0);
     $this->assertFalse($instance->hasSubcategoryFor(DIWikiPage::newFromText('Foo', NS_CATEGORY)));
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:9,代碼來源:PropertyHierarchyLookupTest.php

示例14: testFindRedirectTargetOnSelfReferencedDataItem

 public function testFindRedirectTargetOnSelfReferencedDataItem()
 {
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->setMethods(array('getRedirectTarget'))->getMockForAbstractClass();
     $store->expects($this->never())->method('getRedirectTarget');
     $circularReferenceGuard = $this->getMockBuilder('\\SMW\\CircularReferenceGuard')->disableOriginalConstructor()->getMock();
     $circularReferenceGuard->expects($this->atLeastOnce())->method('isCircularByRecursionFor')->will($this->returnValue(true));
     $instance = new RedirectTargetLookup($store, $circularReferenceGuard);
     $instance->findRedirectTarget(DIWikiPage::newFromText('Foo'));
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:9,代碼來源:RedirectTargetLookupTest.php

示例15: testGetPropertyValuesFromCache

 public function testGetPropertyValuesFromCache()
 {
     $container = $this->getMockBuilder('\\Onoi\\BlobStore\\Container')->disableOriginalConstructor()->getMock();
     $container->expects($this->atLeastOnce())->method('has')->will($this->returnValue(true));
     $container->expects($this->once())->method('get')->with($this->stringContains('Bar:123'))->will($this->returnValue(1001));
     $this->blobStore->expects($this->atLeastOnce())->method('read')->will($this->returnValue($container));
     $instance = new CachedPropertyValuesPrefetcher($this->store, $this->blobStore);
     $this->assertEquals(1001, $instance->getPropertyValues(DIWikiPage::newFromText('Foo#123'), new DIProperty('Bar')));
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:9,代碼來源:CachedPropertyValuesPrefetcherTest.php


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