Issue #3117863 by longwave, Kristen Pol: [Symfony 5] Using the "Symfony\Component\Validator\Constraints\Length" constraint with the "min" option without setting the "allowEmptyString" one is deprecated

merge-requests/2419/head
catch 2020-04-17 09:53:15 +01:00
parent afd616c38d
commit c609c06bb4
2 changed files with 1 additions and 2 deletions

View File

@ -594,7 +594,7 @@ class TypedDataTest extends KernelTestBase {
// Test translating violation messages when pluralization is used.
$definition = DataDefinition::create('string')
->setConstraints([
'Length' => ['min' => 10],
'Length' => ['min' => 10, 'allowEmptyString' => FALSE],
]);
$violations = $this->typedDataManager->create($definition, "short")->validate();
$this->assertEqual($violations->count(), 1);

View File

@ -162,7 +162,6 @@ trait DeprecationListenerTrait {
'Passing arguments to "Symfony\Component\HttpFoundation\Request::isMethodSafe()" has been deprecated since Symfony 4.4; use "Symfony\Component\HttpFoundation\Request::isMethodCacheable()" to check if the method is cacheable instead.',
'The "Symfony\Component\Process\Process::inheritEnvironmentVariables()" method is deprecated since Symfony 4.4, env variables are always inherited.',
'The "Symfony\Component\Debug\BufferingLogger" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorHandler\BufferingLogger" instead.',
'Using the "Symfony\Component\Validator\Constraints\Length" constraint with the "min" option without setting the "allowEmptyString" one is deprecated and defaults to true. In 5.0, it will become optional and default to false.',
// The following deprecation is listed for Twig 2 compatibility when unit
// testing using \Symfony\Component\ErrorHandler\DebugClassLoader.
'The "Twig\Environment::getTemplateClass()" method is considered internal. It may change without further notice. You should not extend it from "Drupal\Core\Template\TwigEnvironment".',