function ValidatorTest::setUp
Same name in other branches
- 8.9.x core/modules/file/tests/src/Kernel/ValidatorTest.php \Drupal\Tests\file\Kernel\ValidatorTest::setUp()
Overrides FileManagedUnitTestBase::setUp
File
-
core/
modules/ file/ tests/ src/ Kernel/ ValidatorTest.php, line 31
Class
- ValidatorTest
- Tests the functions used to validate uploaded files.
Namespace
Drupal\Tests\file\KernelCode
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/vendor/jquery/jquery.min.js');
$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.