|
3 | 3 | namespace Noxlogic\RateLimitBundle\Tests\EventListener; |
4 | 4 |
|
5 | 5 | use Noxlogic\RateLimitBundle\EventListener\HeaderModificationListener; |
6 | | -use Noxlogic\RateLimitBundle\Events\ProxyFilterResponseEvent; |
7 | 6 | use Noxlogic\RateLimitBundle\Service\RateLimitInfo; |
8 | 7 | use Noxlogic\RateLimitBundle\Tests\TestCase; |
9 | 8 | use Symfony\Component\HttpFoundation\Request; |
10 | 9 | use Symfony\Component\HttpFoundation\Response; |
11 | 10 | use Symfony\Component\HttpKernel\Event\ControllerEvent; |
12 | | -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; |
13 | 11 | use Symfony\Component\HttpKernel\Event\ResponseEvent; |
14 | 12 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
15 | 13 |
|
@@ -136,19 +134,15 @@ public function testListenerWithoutRateInfo() |
136 | 134 | } |
137 | 135 |
|
138 | 136 | /** |
139 | | - * @return FilterResponseEvent|ControllerEvent |
| 137 | + * @return ResponseEvent |
140 | 138 | */ |
141 | 139 | protected function createEvent() |
142 | 140 | { |
143 | | - $kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernelInterface')->getMock(); |
| 141 | + $kernel = $this->getMockBuilder(HttpKernelInterface::class)->getMock(); |
144 | 142 | $request = new Request(); |
145 | 143 | $response = new Response(); |
146 | 144 |
|
147 | | - if (class_exists('Symfony\\Component\\HttpKernel\\Event\\ControllerEvent')) { |
148 | | - $event = new ResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response); |
149 | | - } else { |
150 | | - $event = new FilterResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response); |
151 | | - } |
| 145 | + $event = new ResponseEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response); |
152 | 146 |
|
153 | 147 | return $event; |
154 | 148 | } |
|
0 commit comments