本文整理匯總了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);
}