'\'file_validate_extensions\' is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use the \'FileExtension\' constraint instead. See https://www.drupal.org/node/3363700',
E_USER_DEPRECATED
);
// Empty string means all extensions are allowed so we should remove the
@trigger_error('\'file_validate_extensions\' is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use the \'FileExtension\' constraint instead. See https://www.drupal.org/node/3363700',E_USER_DEPRECATED);
unset($validators['file_validate_extensions']);
return$validators['FileExtension']['extensions'];
}
// No validator was provided, so add one using the default list.
@@ -46,6 +46,9 @@ public function validate(FileInterface $file, array $validators): ConstraintViol
foreach($validatorsas$validator=>$options){
if(function_exists($validator)){
@trigger_error('Support for file validation function '.$validator.'() is deprecated in drupal:10.2.0 and will be removed in drupal:11.0.0. Use Symfony Constraints instead. See https://www.drupal.org/node/3363700',E_USER_DEPRECATED);
$this->expectDeprecation('\'file_validate_extensions\' is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use the \'FileExtension\' constraint instead. See https://www.drupal.org/node/3363700');
$files=file_save_upload('file',$validators);
$this->assertCount(1,$files);
$file=$files[0];
// @todo work out why move_uploaded_file() is failing.