本文整理汇总了PHP中WatchedItem::batchAddWatch方法的典型用法代码示例。如果您正苦于以下问题:PHP WatchedItem::batchAddWatch方法的具体用法?PHP WatchedItem::batchAddWatch怎么用?PHP WatchedItem::batchAddWatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WatchedItem
的用法示例。
在下文中一共展示了WatchedItem::batchAddWatch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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]);
}