Code Duplication    Length = 15-15 lines in 2 locations

tests/unit/EventListener/ExceptionListenerTest.php 2 locations

@@ 127-141 (lines=15) @@
124
    /**
125
     * @test
126
     */
127
    public function willLogExceptionsWith4xxCodesAsBadRequestNotices()
128
    {
129
        for ($i = 0; $i < 99; $i++) {
130
            $logger = $this->getMockForAbstractClass(LoggerInterface::class);
131
            $logger
132
                ->expects($this->once())
133
                ->method('log')
134
                ->with(LogLevel::NOTICE, $this->stringStartsWith('Bad Request'));
135
136
            /** @var LoggerInterface $logger */
137
            $this->setLogger($this->exceptionListener, $logger);
138
            $this->codeProperty->setValue($this->exception, 400 + $i);
139
            $this->exceptionListener->onKernelException($this->event);
140
        }
141
    }
142
143
    /**
144
     * @test
@@ 146-160 (lines=15) @@
143
    /**
144
     * @test
145
     */
146
    public function willLogExceptionsWith5xxCodesAsRuntimeErrors()
147
    {
148
        for ($i = 0; $i < 99; $i++) {
149
            $logger = $this->getMockForAbstractClass(LoggerInterface::class);
150
            $logger
151
                ->expects($this->once())
152
                ->method('log')
153
                ->with(LogLevel::ERROR, $this->stringStartsWith('Internal Server Error'));
154
155
            /** @var LoggerInterface $logger */
156
            $this->setLogger($this->exceptionListener, $logger);
157
            $this->codeProperty->setValue($this->exception, 500 + $i);
158
            $this->exceptionListener->onKernelException($this->event);
159
        }
160
    }
161
162
    /**
163
     * @test