Skip to content

Commit 78c7f72

Browse files
committed
Merge branch '4.2'
* 4.2: [Phpunit] fixed support for PHP 5.3 Response prepare method update [Workflow] Added missing license header Fix case when multiple loaders are providing paths for the same namespace Check if Client exists when test.client does not exist, to provide clearer exception message throw TypeErrors to prepare for type hints in 5.0 [Form] Preventing validation of children if parent with Valid constraint has no validation groups [Form] Added ResetInterface to CachingFactoryDecorator Remove deprecated usage [Tests] fixed compatbility of assertEquals(): void Fixed usage of TranslatorInterface in form extension (fixes #30591) [Intl][4.2] Fix test [Intl] Fix test [Validator] Add the missing translations for the Arabic (ar) locale [Intl] Add compile binary Fix DebugCommand when chain loader is involved [Form] Fixed some phpdocs
2 parents 5bdc970 + 9689153 commit 78c7f72

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
5656
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
5757
use Symfony\Component\Finder\Finder;
58+
use Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator;
5859
use Symfony\Component\Form\FormTypeExtensionInterface;
5960
use Symfony\Component\Form\FormTypeGuesserInterface;
6061
use Symfony\Component\Form\FormTypeInterface;
@@ -440,6 +441,11 @@ private function registerFormConfiguration(array $config, ContainerBuilder $cont
440441
if (!class_exists(Translator::class)) {
441442
$container->removeDefinition('form.type_extension.upload.validator');
442443
}
444+
if (!method_exists(CachingFactoryDecorator::class, 'reset')) {
445+
$container->getDefinition('form.choice_list_factory.cached')
446+
->clearTag('kernel.reset')
447+
;
448+
}
443449
}
444450

445451
private function registerEsiConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)

Resources/config/form.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
<service id="form.choice_list_factory.cached" class="Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator">
5959
<argument type="service" id="form.choice_list_factory.property_access"/>
60+
<tag name="kernel.reset" method="reset" />
6061
</service>
6162

6263
<service id="form.choice_list_factory" alias="form.choice_list_factory.cached" />

Test/WebTestCase.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ protected static function createClient(array $options = [], array $server = [])
3636
try {
3737
$client = $kernel->getContainer()->get('test.client');
3838
} catch (ServiceNotFoundException $e) {
39-
throw new \LogicException('You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit".');
39+
if (class_exists(Client::class)) {
40+
throw new \LogicException('You cannot create the client used in functional tests if the "framework.test" config is not set to true.');
41+
}
42+
throw new \LogicException('You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit"');
4043
}
4144

4245
$client->setServerParameters($server);

0 commit comments

Comments
 (0)