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


PHP WatchedItem::getTitle方法代码示例

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


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

示例1: testConstruction

 /**
  * @dataProvider provideUserTitleTimestamp
  */
 public function testConstruction($user, LinkTarget $linkTarget, $notifTimestamp)
 {
     $item = new WatchedItem($user, $linkTarget, $notifTimestamp);
     $this->assertSame($user, $item->getUser());
     $this->assertSame($linkTarget, $item->getLinkTarget());
     $this->assertSame($notifTimestamp, $item->getNotificationTimestamp());
     // The below tests the internal WatchedItem::getTitle method
     $this->assertInstanceOf('Title', $item->getTitle());
     $this->assertSame($linkTarget->getDBkey(), $item->getTitle()->getDBkey());
     $this->assertSame($linkTarget->getFragment(), $item->getTitle()->getFragment());
     $this->assertSame($linkTarget->getNamespace(), $item->getTitle()->getNamespace());
     $this->assertSame($linkTarget->getText(), $item->getTitle()->getText());
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:16,代码来源:WatchedItemUnitTest.php

示例2: testBatchAddWatch

 public function testBatchAddWatch()
 {
     $itemOne = new WatchedItem($this->getMockUser(1), new TitleValue(0, 'Title1'), null);
     $itemTwo = new WatchedItem($this->getMockUser(3), Title::newFromText('Title2'), '20150101010101');
     $store = $this->getMockWatchedItemStore();
     $store->expects($this->exactly(2))->method('addWatchBatchForUser');
     $store->expects($this->at(0))->method('addWatchBatchForUser')->with($itemOne->getUser(), [$itemOne->getTitle()->getSubjectPage(), $itemOne->getTitle()->getTalkPage()]);
     $store->expects($this->at(1))->method('addWatchBatchForUser')->with($itemTwo->getUser(), [$itemTwo->getTitle()->getSubjectPage(), $itemTwo->getTitle()->getTalkPage()]);
     $this->setService('WatchedItemStore', $store);
     WatchedItem::batchAddWatch([$itemOne, $itemTwo]);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:11,代码来源:WatchedItemUnitTest.php


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