本文整理汇总了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());
}
示例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]);
}