8000 Merge branch '5.4' into 6.0 · symfony/symfony@28bc209 · GitHub
[go: up one dir, main page]

Skip to content

Commit 28bc209

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [HttpKernel] Relax some transient tests
2 parents 472409e + fb82a47 commit 28bc209

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

src/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
2020
use Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface;
2121

22-
/**
23-
* @group time-sensitive
24-
*/
2522
class FragmentHandlerTest extends TestCase
2623
{
2724
private $requestStack;
@@ -71,7 +68,20 @@ public function testDeliverWithUnsuccessfulResponse()
7168

7269
public function testRender()
7370
{
74-
$handler = $this->getHandler($this->returnValue(new Response('foo')), ['/', Request::create('/'), ['foo' => 'foo', 'ignore_errors' => true]]);
71+
$expectedRequest = Request::create('/');
72+
$handler = $this->getHandler(
73+
$this->returnValue(new Response('foo')),
74+
[
75+
'/',
76+
$this->callback(function (Request $request) use ($expectedRequest) {
77+
$expectedRequest->server->remove('REQUEST_TIME_FLOAT');
78+
$request->server->remove('REQUEST_TIME_FLOAT');
79+
80+
return $expectedRequest == $request;
81+
}),
82+
['foo' => 'foo', 'ignore_errors' => true],
83+
]
84+
);
7585

7686
$this->assertEquals('foo', $handler->render('/', 'foo', ['foo' => 'foo']));
7787
}

src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,18 @@ public function testIpAddressOfRangedTrustedProxyIsSetAsRemote()
261261
/**
262262
* Creates a Kernel expecting a request equals to $request.
263263
*/
264-
private function getKernelExpectingRequest(Request $request, $strict = false)
264+
private function getKernelExpectingRequest(Request $expectedRequest)
265265
{
266266
$kernel = $this->createMock(HttpKernelInterface::class);
267267
$kernel
268268
->expects($this->once())
269269
->method('handle')
270-
->with($request)
270+
->with($this->callback(function (Request $request) use ($expectedRequest) {
271+
$expectedRequest->server->remove('REQUEST_TIME_FLOAT');
272+
$request->server->remove('REQUEST_TIME_FLOAT');
273+
274+
return $expectedRequest == $request;
275+
}))
271276
->willReturn(new Response('foo'));
272277

273278
return $kernel;

0 commit comments

Comments
 (0)
0