예제 #1
0
 public function testGetAlertSettings()
 {
     $this->logIn("ROLE_USER");
     $this->client->request('GET', '/api/alertSettings');
     $this->assertJsonResponse($this->client->getResponse());
     $this->assertJsonStringEqualsJsonString(json_encode(AlertSetting::getAll()), $this->getResponseContent(TRUE));
 }
예제 #2
0
 public function testShouldBeAlertedWithUserNotInResultGroup()
 {
     $result = $this->getMockResult(TRUE, FALSE);
     $result->setStatus(ResultStatus::FAILED)->setInfo("Stahp shut up and take my money scumbag stacy trollface.");
     foreach (AlertSetting::getAll() as $setting => $description) {
         $this->user->setAlertSetting($setting);
         $this->assertFalse($this->user->shouldBeAlerted($result));
     }
 }
예제 #3
0
 /**
  * Returns the list of possible alert settings
  * 
  * @Route("/alertSettings")
  * @Method({"GET"})
  * @ApiDoc(
  *     resource=true,
  *     tags={
  *         "Super Admin" = "#ff1919",
  *         "Admin" = "#ffff33",
  *         "User" = "#75ff47"
  *     }
  * )
  */
 public function getAlertSettings()
 {
     return new JsonResponse(AlertSetting::getAll());
 }
예제 #4
0
파일: User.php 프로젝트: amyboyd/overwatch
 /**
  * Set this user's alert setting
  * 
  * @param integer $setting
  * @return User
  */
 public function setAlertSetting($setting)
 {
     AlertSetting::isValid($setting);
     $this->alertSetting = $setting;
     return $this;
 }