コード例 #1
0
 /**
  * @Given /^I reset "([^"]*)" from notifications/
  */
 public function iResetFromNotifications($notice_id)
 {
     if ($results = Notification::find($notice_id)) {
         $results->delete();
     }
 }
コード例 #2
0
 /**
  * @test
  */
 public function should_make_many_notifications()
 {
     //Arrange
     $before = Notification::all()->count();
     $listener = new NotificationsListener($this->app);
     $listener->setEventName('diff_tool.file_uploads_ready_to_compare');
     $message = (object) ['project_id' => 'mock-project-1', 'request_id' => 'mock-request-1', 'stage' => 1];
     //Act
     $listener->filesUploadReadyToCompareNotice($message);
     //Assert
     $after = Notification::all()->count();
     $this->assertGreaterThan($before, $after);
     $this->assertEquals(2, count($listener->getNotificationsMade()));
 }
コード例 #3
0
 public function to($to_id)
 {
     return $this->notification_model->with('notification_message')->toId($to_id)->fromId($this->getFromId())->read($this->getRead())->take($this->getLimit())->orderBy('created_at', $this->getOrder())->get();
 }