| @@ 88-102 (lines=15) @@ | ||
| 85 | /** |
|
| 86 | * @test |
|
| 87 | */ |
|
| 88 | public function willLogExceptionsWith4xxCodesAsBadRequestNotices() |
|
| 89 | { |
|
| 90 | for ($i = 0; $i < 99; $i++) { |
|
| 91 | $logger = $this->getMockForAbstractClass('Psr\Log\LoggerInterface'); |
|
| 92 | $logger |
|
| 93 | ->expects($this->once()) |
|
| 94 | ->method('log') |
|
| 95 | ->with(LogLevel::NOTICE, $this->stringStartsWith('Bad Request')); |
|
| 96 | ||
| 97 | /** @var LoggerInterface $logger */ |
|
| 98 | $this->exceptionListener->setLogger($logger); |
|
| 99 | $this->codeProperty->setValue($this->exception, 400 + $i); |
|
| 100 | $this->exceptionListener->onKernelException($this->event); |
|
| 101 | } |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * @test |
|
| @@ 107-121 (lines=15) @@ | ||
| 104 | /** |
|
| 105 | * @test |
|
| 106 | */ |
|
| 107 | public function willLogExceptionsWith5xxCodesAsRuntimeErrors() |
|
| 108 | { |
|
| 109 | for ($i = 0; $i < 99; $i++) { |
|
| 110 | $logger = $this->getMockForAbstractClass('Psr\Log\LoggerInterface'); |
|
| 111 | $logger |
|
| 112 | ->expects($this->once()) |
|
| 113 | ->method('log') |
|
| 114 | ->with(LogLevel::ERROR, $this->stringStartsWith('Internal Server Error')); |
|
| 115 | ||
| 116 | /** @var LoggerInterface $logger */ |
|
| 117 | $this->exceptionListener->setLogger($logger); |
|
| 118 | $this->codeProperty->setValue($this->exception, 500 + $i); |
|
| 119 | $this->exceptionListener->onKernelException($this->event); |
|
| 120 | } |
|
| 121 | } |
|
| 122 | ||
| 123 | /** |
|
| 124 | * @test |
|