Skip to content

Commit 40aa18d

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [HttpClient] Fix setting CURLMOPT_MAXCONNECTS throw a meaningful exception when parsing dotenv files with BOM [Cache] Fix RedisSentinel params types [FrameworkBundle] Fix service reset between tests [Uid][Serializer][Validator] Mention RFC 9562 make sure temp files can be cleaned up on Windows
2 parents 35785c1 + 32c98b3 commit 40aa18d

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

Test/KernelTestCase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ protected static function ensureKernelShutdown()
129129
static::$kernel->shutdown();
130130
static::$booted = false;
131131

132+
if ($container->has('services_resetter')) {
133+
// Instantiate the service because Container::reset() only resets services that have been used
134+
$container->get('services_resetter');
135+
}
136+
132137
if ($container instanceof ResetInterface) {
133138
$container->reset();
134139
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestServiceContainer;
13+
14+
class ResettableService
15+
{
16+
private $count = 0;
17+
18+
public function myCustomName(): void
19+
{
20+
++$this->count;
21+
}
22+
23+
public function getCount(): int
24+
{
25+
return $this->count;
26+
}
27+
}

Tests/Functional/app/TestServiceContainer/services.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ services:
2323
decorates: decorated
2424
properties:
2525
inner: '@.inner'
26+
27+
Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestServiceContainer\ResettableService:
28+
public: true
29+
tags:
30+
- kernel.reset: { method: 'myCustomName' }

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"ext-xml": "*",
2222
"symfony/cache": "^5.4|^6.0|^7.0",
2323
"symfony/config": "^6.1|^7.0",
24-
"symfony/dependency-injection": "^6.4|^7.0",
24+
"symfony/dependency-injection": "^6.4.12|^7.0",
2525
"symfony/deprecation-contracts": "^2.5|^3",
2626
"symfony/error-handler": "^6.1|^7.0",
2727
"symfony/event-dispatcher": "^5.4|^6.0|^7.0",

0 commit comments

Comments
 (0)