Skip to content

Commit b7ee4af

Browse files
Merge branch '4.4' into 5.4
* 4.4: [DoctrineBridge] Treat firstResult === 0 like null [HttpKernel] Fix SessionListener without session in request #46268
2 parents 13c0d9c + f5b6fa2 commit b7ee4af

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Tests/Firewall/ContextListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,10 @@ public function testOnKernelResponseRemoveListener()
398398
$listener = new ContextListener($tokenStorage, [], 'session', null, $dispatcher, null, \Closure::fromCallable([$tokenStorage, 'getToken']));
399399
$this->assertEmpty($dispatcher->getListeners());
400400

401-
$listener(new RequestEvent($httpKernel, $request, HttpKernelInterface::MASTER_REQUEST));
401+
$listener(new RequestEvent($httpKernel, $request, HttpKernelInterface::MAIN_REQUEST));
402402
$this->assertNotEmpty($dispatcher->getListeners());
403403

404-
$listener->onKernelResponse(new ResponseEvent($httpKernel, $request, HttpKernelInterface::MASTER_REQUEST, new Response()));
404+
$listener->onKernelResponse(new ResponseEvent($httpKernel, $request, HttpKernelInterface::MAIN_REQUEST, new Response()));
405405
$this->assertEmpty($dispatcher->getListeners());
406406
}
407407

Tests/Firewall/RememberMeListenerTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testOnCoreSecurityDoesNotTryToPopulateNonEmptyTokenStorage()
4848
->method('setToken')
4949
;
5050

51-
$this->assertNull($listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MASTER_REQUEST)));
51+
$this->assertNull($listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MAIN_REQUEST)));
5252
}
5353

5454
public function testOnCoreSecurityDoesNothingWhenNoCookieIsSet()
@@ -67,7 +67,7 @@ public function testOnCoreSecurityDoesNothingWhenNoCookieIsSet()
6767
->willReturn(null)
6868
;
6969

70-
$this->assertNull($listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MASTER_REQUEST)));
70+
$this->assertNull($listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MAIN_REQUEST)));
7171
}
7272

7373
public function testOnCoreSecurityIgnoresAuthenticationExceptionThrownByAuthenticationManagerImplementation()
@@ -100,7 +100,7 @@ public function testOnCoreSecurityIgnoresAuthenticationExceptionThrownByAuthenti
100100
->willThrowException($exception)
101101
;
102102

103-
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MASTER_REQUEST));
103+
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST));
104104
}
105105

106106
public function testOnCoreSecurityIgnoresAuthenticationOptionallyRethrowsExceptionThrownAuthenticationManagerImplementation()
@@ -133,7 +133,7 @@ public function testOnCoreSecurityIgnoresAuthenticationOptionallyRethrowsExcepti
133133
->willThrowException($exception)
134134
;
135135

136-
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MASTER_REQUEST));
136+
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MAIN_REQUEST));
137137
}
138138

139139
public function testOnCoreSecurityAuthenticationExceptionDuringAutoLoginTriggersLoginFail()
@@ -163,7 +163,7 @@ public function testOnCoreSecurityAuthenticationExceptionDuringAutoLoginTriggers
163163
->method('authenticate')
164164
;
165165

166-
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MASTER_REQUEST));
166+
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MAIN_REQUEST));
167167
}
168168

169169
public function testOnCoreSecurity()
@@ -195,7 +195,7 @@ public function testOnCoreSecurity()
195195
->willReturn($token)
196196
;
197197

198-
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MASTER_REQUEST));
198+
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), new Request(), HttpKernelInterface::MAIN_REQUEST));
199199
}
200200

201201
public function testSessionStrategy()
@@ -243,7 +243,7 @@ public function testSessionStrategy()
243243
->willReturn(null)
244244
;
245245

246-
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MASTER_REQUEST));
246+
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST));
247247
}
248248

249249
public function testSessionIsMigratedByDefault()
@@ -289,7 +289,7 @@ public function testSessionIsMigratedByDefault()
289289
$request = new Request();
290290
$request->setSession($session);
291291

292-
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MASTER_REQUEST));
292+
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST));
293293
}
294294

295295
public function testOnCoreSecurityInteractiveLoginEventIsDispatchedIfDispatcherIsPresent()

Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public function testInvalidCsrfToken($invalidToken)
264264
$csrfTokenManager
265265
);
266266

267-
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MASTER_REQUEST));
267+
$listener(new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST));
268268
}
269269

270270
public function postOnlyDataProvider(): array

0 commit comments

Comments
 (0)