Skip to content

Commit a0d887d

Browse files
committed
[HttpKernel] Declare properties used by CacheAttributeListenerTest explicitly
1 parent 4a8426e commit a0d887d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Tests/EventListener/CacheAttributeListenerTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424

2525
class CacheAttributeListenerTest extends TestCase
2626
{
27+
private CacheAttributeListener $listener;
28+
private Response $response;
29+
private Cache $cache;
30+
private Request $request;
31+
private ResponseEvent $event;
32+
2733
protected function setUp(): void
2834
{
2935
$this->listener = new CacheAttributeListener();
@@ -294,12 +300,12 @@ public function testAttribute()
294300
$this->assertSame(CacheAttributeController::CLASS_SMAXAGE, $response->getMaxAge());
295301
}
296302

297-
private function createRequest(Cache $cache = null)
303+
private function createRequest(Cache $cache): Request
298304
{
299305
return new Request([], [], ['_cache' => [$cache]]);
300306
}
301307

302-
private function createEventMock(Request $request, Response $response)
308+
private function createEventMock(Request $request, Response $response): ResponseEvent
303309
{
304310
return new ResponseEvent($this->getKernel(), $request, HttpKernelInterface::MAIN_REQUEST, $response);
305311
}

0 commit comments

Comments
 (0)