| @@ 42-54 (lines=13) @@ | ||
| 39 | /** |
|
| 40 | * @return void |
|
| 41 | */ |
|
| 42 | public function testAlert() |
|
| 43 | { |
|
| 44 | $message = 'This is a alert'; |
|
| 45 | $context = [ |
|
| 46 | 'key' => 'value', |
|
| 47 | ]; |
|
| 48 | $this->sentryClient->expects($this->once())->method('captureMessage')->with($message, [ |
|
| 49 | 'extra' => $context, |
|
| 50 | 'level' => 'error', |
|
| 51 | ]); |
|
| 52 | ||
| 53 | $this->sentryLogger->alert($message, $context); |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * @return void |
|
| @@ 59-71 (lines=13) @@ | ||
| 56 | /** |
|
| 57 | * @return void |
|
| 58 | */ |
|
| 59 | public function testCritical() |
|
| 60 | { |
|
| 61 | $message = 'This is a alert'; |
|
| 62 | $context = [ |
|
| 63 | 'key' => 'value', |
|
| 64 | ]; |
|
| 65 | $this->sentryClient->expects($this->once())->method('captureMessage')->with($message, [ |
|
| 66 | 'extra' => $context, |
|
| 67 | 'level' => 'fatal', |
|
| 68 | ]); |
|
| 69 | ||
| 70 | $this->sentryLogger->critical($message, $context); |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * @return void |
|
| @@ 76-88 (lines=13) @@ | ||
| 73 | /** |
|
| 74 | * @return void |
|
| 75 | */ |
|
| 76 | public function testDebug() |
|
| 77 | { |
|
| 78 | $message = 'This is a alert'; |
|
| 79 | $context = [ |
|
| 80 | 'key' => 'value', |
|
| 81 | ]; |
|
| 82 | $this->sentryClient->expects($this->once())->method('captureMessage')->with($message, [ |
|
| 83 | 'extra' => $context, |
|
| 84 | 'level' => 'debug', |
|
| 85 | ]); |
|
| 86 | ||
| 87 | $this->sentryLogger->debug($message, $context); |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * @return void |
|
| @@ 93-105 (lines=13) @@ | ||
| 90 | /** |
|
| 91 | * @return void |
|
| 92 | */ |
|
| 93 | public function testEmergency() |
|
| 94 | { |
|
| 95 | $message = 'This is a alert'; |
|
| 96 | $context = [ |
|
| 97 | 'key' => 'value', |
|
| 98 | ]; |
|
| 99 | $this->sentryClient->expects($this->once())->method('captureMessage')->with($message, [ |
|
| 100 | 'extra' => $context, |
|
| 101 | 'level' => 'fatal', |
|
| 102 | ]); |
|
| 103 | ||
| 104 | $this->sentryLogger->emergency($message, $context); |
|
| 105 | } |
|
| 106 | ||
| 107 | /** |
|
| 108 | * @return void |
|
| @@ 110-122 (lines=13) @@ | ||
| 107 | /** |
|
| 108 | * @return void |
|
| 109 | */ |
|
| 110 | public function testInfo() |
|
| 111 | { |
|
| 112 | $message = 'This is a alert'; |
|
| 113 | $context = [ |
|
| 114 | 'key' => 'value', |
|
| 115 | ]; |
|
| 116 | $this->sentryClient->expects($this->once())->method('captureMessage')->with($message, [ |
|
| 117 | 'extra' => $context, |
|
| 118 | 'level' => 'info', |
|
| 119 | ]); |
|
| 120 | ||
| 121 | $this->sentryLogger->info($message, $context); |
|
| 122 | } |
|
| 123 | ||
| 124 | /** |
|
| 125 | * @return void |
|
| @@ 145-157 (lines=13) @@ | ||
| 142 | /** |
|
| 143 | * @return void |
|
| 144 | */ |
|
| 145 | public function testNotice() |
|
| 146 | { |
|
| 147 | $message = 'This is a alert'; |
|
| 148 | $context = [ |
|
| 149 | 'key' => 'value', |
|
| 150 | ]; |
|
| 151 | $this->sentryClient->expects($this->once())->method('captureMessage')->with($message, [ |
|
| 152 | 'extra' => $context, |
|
| 153 | 'level' => 'info', |
|
| 154 | ]); |
|
| 155 | ||
| 156 | $this->sentryLogger->notice($message, $context); |
|
| 157 | } |
|
| 158 | ||
| 159 | /** |
|
| 160 | * @return void |
|
| @@ 162-174 (lines=13) @@ | ||
| 159 | /** |
|
| 160 | * @return void |
|
| 161 | */ |
|
| 162 | public function testWarning() |
|
| 163 | { |
|
| 164 | $message = 'This is a alert'; |
|
| 165 | $context = [ |
|
| 166 | 'key' => 'value', |
|
| 167 | ]; |
|
| 168 | $this->sentryClient->expects($this->once())->method('captureMessage')->with($message, [ |
|
| 169 | 'extra' => $context, |
|
| 170 | 'level' => 'warning', |
|
| 171 | ]); |
|
| 172 | ||
| 173 | $this->sentryLogger->warning($message, $context); |
|
| 174 | } |
|
| 175 | } |
|