function FileImageDimensionsConstraintValidatorTest::setUp
Same name in other branches
- 10 core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileImageDimensionsConstraintValidatorTest.php \Drupal\Tests\file\Kernel\Plugin\Validation\Constraint\FileImageDimensionsConstraintValidatorTest::setUp()
Overrides FileValidatorTestBase::setUp
File
-
core/
modules/ file/ tests/ src/ Kernel/ Plugin/ Validation/ Constraint/ FileImageDimensionsConstraintValidatorTest.php, line 36
Class
- FileImageDimensionsConstraintValidatorTest
- Tests the FileImageDimensionsConstraintValidator.
Namespace
Drupal\Tests\file\Kernel\Plugin\Validation\ConstraintCode
protected function setUp() : void {
parent::setUp();
$this->image = File::create();
$this->image
->setFileUri('core/misc/druplicon.png');
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$this->image
->setFilename($file_system->basename($this->image
->getFileUri()));
$this->nonImage = File::create();
$this->nonImage
->setFileUri('core/assets/scaffold/README.txt');
$this->nonImage
->setFilename($file_system->basename($this->nonImage
->getFileUri()));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.