예제 #1
0
 /**
  * @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);
 }