|
@@ 157-171 (lines=15) @@
|
| 154 |
|
$this->exceptionListener->onKernelException($event); |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
public function testWillLogExceptionsWith4xxCodesAsBadRequestNotices() |
| 158 |
|
{ |
| 159 |
|
for ($i = 0; $i < 99; $i++) { |
| 160 |
|
$logger = $this->getMockForAbstractClass(LoggerInterface::class); |
| 161 |
|
$logger |
| 162 |
|
->expects($this->once()) |
| 163 |
|
->method('log') |
| 164 |
|
->with(LogLevel::NOTICE, $this->stringStartsWith('Bad Request')); |
| 165 |
|
|
| 166 |
|
/** @var LoggerInterface $logger */ |
| 167 |
|
$this->setLogger($this->exceptionListener, $logger); |
| 168 |
|
$this->codeProperty->setValue($this->exception, 400 + $i); |
| 169 |
|
$this->exceptionListener->onKernelException($this->event); |
| 170 |
|
} |
| 171 |
|
} |
| 172 |
|
|
| 173 |
|
public function testWillLogExceptionsWith5xxCodesAsRuntimeErrors() |
| 174 |
|
{ |
|
@@ 173-187 (lines=15) @@
|
| 170 |
|
} |
| 171 |
|
} |
| 172 |
|
|
| 173 |
|
public function testWillLogExceptionsWith5xxCodesAsRuntimeErrors() |
| 174 |
|
{ |
| 175 |
|
for ($i = 0; $i < 99; $i++) { |
| 176 |
|
$logger = $this->getMockForAbstractClass(LoggerInterface::class); |
| 177 |
|
$logger |
| 178 |
|
->expects($this->once()) |
| 179 |
|
->method('log') |
| 180 |
|
->with(LogLevel::ERROR, $this->stringStartsWith('Internal Server Error')); |
| 181 |
|
|
| 182 |
|
/** @var LoggerInterface $logger */ |
| 183 |
|
$this->setLogger($this->exceptionListener, $logger); |
| 184 |
|
$this->codeProperty->setValue($this->exception, 500 + $i); |
| 185 |
|
$this->exceptionListener->onKernelException($this->event); |
| 186 |
|
} |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
public function testWillLogExceptionsWithUnexpectedCodesAsCriticalErrors() |
| 190 |
|
{ |