Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e6e641c

Browse filesBrowse files
committed
minor #43264 [HttpKernel] Relax some transient tests (chalasr)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel] Relax some transient tests | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - As observed in #42824 and more recently #43138, these tests randomly break for some reason. Replaces #42824 Commits ------- 30fa29f [HttpKernel] Relax some transient tests
2 parents 7b9fc09 + 30fa29f commit e6e641c
Copy full SHA for e6e641c

File tree

Expand file treeCollapse file tree

2 files changed

+21
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+21
-6
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php
+14-4Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
1919
use Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface;
2020

21-
/**
22-
* @group time-sensitive
23-
*/
2421
class FragmentHandlerTest extends TestCase
2522
{
2623
private $requestStack;
@@ -61,7 +58,20 @@ public function testDeliverWithUnsuccessfulResponse()
6158

6259
public function testRender()
6360
{
64-
$handler = $this->getHandler($this->returnValue(new Response('foo')), ['/', Request::create('/'), ['foo' => 'foo', 'ignore_errors' => true]]);
61+
$expectedRequest = Request::create('/');
62+
$handler = $this->getHandler(
63+
$this->returnValue(new Response('foo')),
64+
[
65+
'/',
66+
$this->callback(function (Request $request) use ($expectedRequest) {
67+
$expectedRequest->server->remove('REQUEST_TIME_FLOAT');
68+
$request->server->remove('REQUEST_TIME_FLOAT');
69+
70+
return $expectedRequest == $request;
71+
}),
72+
['foo' => 'foo', 'ignore_errors' => true],
73+
]
74+
);
6575

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

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
+7-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.