function ExtensionViewsFieldTest::setUp
Same name in other branches
- 8.9.x core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php \Drupal\Tests\file\Kernel\Views\ExtensionViewsFieldTest::setUp()
- 10 core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php \Drupal\Tests\file\Kernel\Views\ExtensionViewsFieldTest::setUp()
- 11.x core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php \Drupal\Tests\file\Kernel\Views\ExtensionViewsFieldTest::setUp()
Overrides ViewsKernelTestBase::setUp
File
-
core/
modules/ file/ tests/ src/ Kernel/ Views/ ExtensionViewsFieldTest.php, line 33
Class
- ExtensionViewsFieldTest
- Tests the core Drupal\file\Plugin\views\field\Extension handler.
Namespace
Drupal\Tests\file\Kernel\ViewsCode
protected function setUp($import_test_views = TRUE) : void {
parent::setUp();
ViewTestData::createTestViews(static::class, [
'file_test_views',
]);
$this->installEntitySchema('file');
file_put_contents('public://file.png', '');
File::create([
'uri' => 'public://file.png',
'filename' => 'file.png',
])->save();
file_put_contents('public://file.tar', '');
File::create([
'uri' => 'public://file.tar',
'filename' => 'file.tar',
])->save();
file_put_contents('public://file.tar.gz', '');
File::create([
'uri' => 'public://file.tar.gz',
'filename' => 'file.tar.gz',
])->save();
file_put_contents('public://file', '');
File::create([
'uri' => 'public://file',
'filename' => 'file',
])->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.