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


PHP DIWikiPage::getTitle方法代码示例

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


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

示例1: tryToFindLinksFor

 /**
  * @since  1.0
  *
  * @param DIWikiPage $subject
  */
 public function tryToFindLinksFor(DIWikiPage $subject)
 {
     $prefixedText = $subject->getTitle()->getPrefixedText();
     if (!$this->canBuildLinksFromText($prefixedText)) {
         return;
     }
     $this->buildHierarchicalLinksFromText($prefixedText);
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:13,代码来源:BySubpageLinksFinder.php

示例2: testReUploadDummyTextFileToEditFilePage

 /**
  * @depends testFileUploadForDummyTextFile
  */
 public function testReUploadDummyTextFileToEditFilePage()
 {
     $subject = new DIWikiPage('Foo.txt', NS_FILE);
     $dummyTextFile = $this->fixturesFileProvider->newUploadForDummyTextFile('Foo.txt');
     $dummyTextFile->doUpload();
     $this->pageEditor->editPage($subject->getTitle())->doEdit('[[Ichi::Maru|Kyū]]');
     // File page content is kept from the initial upload
     $expected = array('propertyCount' => 4, 'propertyKeys' => array('HasFile', '_MEDIA', '_MIME', '_SKEY', 'Ichi'), 'propertyValues' => array('File:Foo.txt', 'TEXT', 'text/plain', 'Foo.txt', 'Maru'));
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $this->getStore()->getSemanticData($subject));
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:13,代码来源:FileUploadIntegrationTest.php

示例3: testExportRedirect

 public function testExportRedirect()
 {
     $semanticData = $this->semanticDataFactory->newEmptySemanticData(__METHOD__);
     $redirectProperty = new DIProperty('_REDI');
     $redirectTarget = new DIWikiPage('FooRedirectTarget', NS_MAIN, '');
     $semanticData->addPropertyObjectValue($redirectProperty, DIWikiPage::newFromTitle($redirectTarget->getTitle(), '__red'));
     $exportData = Exporter::getInstance()->makeExportData($semanticData);
     $this->assertCount(1, $exportData->getValues(Exporter::getInstance()->getSpecialNsResource('swivt', 'redirectsTo')));
     $this->assertCount(1, $exportData->getValues(Exporter::getInstance()->getSpecialNsResource('owl', 'sameAs')));
     $expectedResourceElement = new ExpNsResource('FooRedirectTarget', Exporter::getInstance()->getNamespaceUri('wiki'), 'wiki', $redirectTarget);
     $this->exportDataValidator->assertThatExportDataContainsResource($expectedResourceElement, Exporter::getInstance()->getSpecialNsResource('owl', 'sameAs'), $exportData);
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:12,代码来源:ExportSemanticDataTest.php

示例4: testFileUploadForDummyTextFile

 public function testFileUploadForDummyTextFile()
 {
     $subject = new DIWikiPage('RdfLinkedFile.txt', NS_FILE);
     $fileNS = Localizer::getInstance()->getNamespaceTextById(NS_FILE);
     $dummyTextFile = $this->fixturesFileProvider->newUploadForDummyTextFile('RdfLinkedFile.txt');
     $dummyTextFile->doUpload('[[HasFile::File:RdfLinkedFile.txt]]');
     $exportController = new ExportController(new RDFXMLSerializer());
     $exportController->enableBacklinks(false);
     ob_start();
     $exportController->printPages(array($subject->getTitle()->getPrefixedDBKey()));
     $output = ob_get_clean();
     $expected = array("<rdfs:label>{$fileNS}:RdfLinkedFile.txt</rdfs:label>", '<swivt:file rdf:resource="' . $dummyTextFile->getLocalFile()->getFullURL() . '"/>', '<property:Media_type-23aux rdf:datatype="http://www.w3.org/2001/XMLSchema#string">TEXT</property:Media_type-23aux>', '<property:MIME_type-23aux rdf:datatype="http://www.w3.org/2001/XMLSchema#string">text/plain</property:MIME_type-23aux>');
     $this->stringValidator->assertThatStringContains($expected, $output);
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:14,代码来源:RdfFileResourceTest.php

示例5: getDemographics

 /**
  * @since 2.1
  *
  * @see https://en.wikipedia.org/wiki/Demographics_of_Paris
  *
  * @return Subobject
  */
 public function getDemographics()
 {
     if ($this->targetSubject === null) {
         throw new RuntimeException('Expected a target subject');
     }
     $subobject = new Subobject($this->targetSubject->getTitle());
     $subobject->setEmptyContainerForId('Paris#Demographics');
     $yearProperty = new YearProperty();
     $yearDataValue = $this->dataValueFactory->newPropertyObjectValue($yearProperty->getProperty(), '2009');
     $subobject->addDataValue($yearDataValue);
     $subobject->addDataValue($this->getAreaValue());
     $subobject->addDataValue($this->getPopulationValue());
     $subobject->addDataValue($this->getPopulationDensityValue());
     return $subobject;
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:22,代码来源:ParisFactsheet.php

示例6: testForYetUnknownRedirectTarget

 public function testForYetUnknownRedirectTarget()
 {
     $revision = $this->getMockBuilder('\\Revision')->disableOriginalConstructor()->getMock();
     $wikiPage = $this->getMockBuilder('\\WikiPage')->disableOriginalConstructor()->getMock();
     $wikiPage->expects($this->atLeastOnce())->method('getRevision')->will($this->returnValue($revision));
     $pageCreator = $this->getMockBuilder('\\SMW\\MediaWiki\\PageCreator')->disableOriginalConstructor()->getMock();
     $pageCreator->expects($this->atLeastOnce())->method('createPage')->will($this->returnValue($wikiPage));
     $this->applicationFactory->registerObject('PageCreator', $pageCreator);
     $subject = new DIWikiPage('Foo', NS_MAIN);
     $target = new DIWikiPage('Bar', NS_MAIN);
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $store->expects($this->once())->method('changeTitle')->with($this->equalTo($subject->getTitle()), $this->equalTo($target->getTitle()), $this->anything(), $this->anything());
     $semanticData = new SemanticData($subject);
     $semanticData->addPropertyObjectValue(new DIProperty('_REDI'), $target);
     $instance = new StoreUpdater($store, $semanticData);
     $instance->setUpdateJobsEnabledState(true);
     $instance->doUpdate();
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:18,代码来源:StoreUpdaterTest.php

示例7: testGetTitleAndNewFromTitleRoundrtip

 /**
  * @dataProvider instanceProvider
  */
 public function testGetTitleAndNewFromTitleRoundrtip(DIWikiPage $di)
 {
     $newDi = DIWikiPage::newFromTitle($di->getTitle());
     $this->assertTrue($newDi->equals($di));
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:8,代码来源:DIWikiPageTest.php


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