/**
  * @return \OC_OCS_Result
  */
 public function disableMonthly()
 {
     $this->jobList->remove('OCA\\PopularityContestClient\\MonthlyReport');
     $notification = $this->manager->createNotification();
     $notification->setApp('popularitycontestclient');
     $this->manager->markProcessed($notification);
     return new \OC_OCS_Result();
 }
 /**
  * @param int $id
  * @return Response
  */
 public function delete($id)
 {
     $this->manager->delete($id);
     $notification = $this->notificationManager->createNotification();
     $notification->setApp('announcementcenter')->setObject('announcement', $id);
     $this->notificationManager->markProcessed($notification);
     return new Response();
 }
Exemple #3
0
 public function testMarkProcessed()
 {
     /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
     $notification = $this->getMockBuilder('OC\\Notification\\INotification')->disableOriginalConstructor()->getMock();
     /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
     $app = $this->getMockBuilder('OC\\Notification\\IApp')->disableOriginalConstructor()->getMock();
     $app->expects($this->once())->method('markProcessed')->with($notification);
     /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
     $app2 = $this->getMockBuilder('OC\\Notification\\IApp')->disableOriginalConstructor()->getMock();
     $app2->expects($this->once())->method('markProcessed')->with($notification);
     $this->manager->registerApp(function () use($app) {
         return $app;
     });
     $this->manager->registerApp(function () use($app2) {
         return $app2;
     });
     $this->manager->markProcessed($notification);
 }
Exemple #4
0
 /**
  * @param int $remoteShare
  */
 protected function scrapNotification($remoteShare)
 {
     $filter = $this->notificationManager->createNotification();
     $filter->setApp('files_sharing')->setUser($this->uid)->setObject('remote_share', (int) $remoteShare);
     $this->notificationManager->markProcessed($filter);
 }