readOne() public method

Make Read One Notification.
public readOne ( Notification $notification ) : boolean | Notification
$notification Fenos\Notifynder\Models\Notification
return boolean | Fenos\Notifynder\Models\Notification
Ejemplo n.º 1
0
 /** @test */
 public function it_read_one_notification_by_id(NotificationDB $notificationRepo)
 {
     $notification_id = 1;
     $notification = new Notification();
     $notificationRepo->find($notification_id)->shouldBeCalled()->willReturn($notification);
     $notificationRepo->readOne($notification)->shouldBeCalled()->willReturn($notification);
     $this->readOne($notification_id)->shouldReturnAnInstanceOf($notification);
 }
 /**
  * Make read one notification giving
  * the ID of it
  *
  * @param $notification_id
  * @return bool|\Fenos\Notifynder\Models\Notification
  */
 public function readOne($notification_id)
 {
     $notification = $this->find($notification_id);
     return $this->notifynderRepo->readOne($notification);
 }