本文整理汇总了PHP中WatchedItem::resetNotificationTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP WatchedItem::resetNotificationTimestamp方法的具体用法?PHP WatchedItem::resetNotificationTimestamp怎么用?PHP WatchedItem::resetNotificationTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WatchedItem
的用法示例。
在下文中一共展示了WatchedItem::resetNotificationTimestamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testResetNotificationTimestamp
/**
* @dataProvider provideUserTitleTimestamp
*/
public function testResetNotificationTimestamp($user, $linkTarget, $timestamp)
{
$force = 'XXX';
$oldid = 999;
$store = $this->getMockWatchedItemStore();
$store->expects($this->once())->method('resetNotificationTimestamp')->with($user, $this->isInstanceOf(Title::class), $force, $oldid)->will($this->returnCallback(function ($user, Title $title, $force, $oldid) use($linkTarget) {
/** @var LinkTarget $linkTarget */
$this->assertInstanceOf('Title', $title);
$this->assertSame($linkTarget->getDBkey(), $title->getDBkey());
$this->assertSame($linkTarget->getFragment(), $title->getFragment());
$this->assertSame($linkTarget->getNamespace(), $title->getNamespace());
$this->assertSame($linkTarget->getText(), $title->getText());
return true;
}));
$this->setService('WatchedItemStore', $store);
$item = new WatchedItem($user, $linkTarget, $timestamp);
$item->resetNotificationTimestamp($force, $oldid);
}