function AccessTest::setUp
Same name in this branch
- 8.9.x core/modules/views/tests/src/Functional/Plugin/AccessTest.php \Drupal\Tests\views\Functional\Plugin\AccessTest::setUp()
Same name in other branches
- 9 core/modules/file/tests/src/Kernel/AccessTest.php \Drupal\Tests\file\Kernel\AccessTest::setUp()
- 9 core/modules/views/tests/src/Functional/Plugin/AccessTest.php \Drupal\Tests\views\Functional\Plugin\AccessTest::setUp()
- 10 core/modules/file/tests/src/Kernel/AccessTest.php \Drupal\Tests\file\Kernel\AccessTest::setUp()
- 10 core/modules/views/tests/src/Functional/Plugin/AccessTest.php \Drupal\Tests\views\Functional\Plugin\AccessTest::setUp()
- 11.x core/modules/file/tests/src/Kernel/AccessTest.php \Drupal\Tests\file\Kernel\AccessTest::setUp()
- 11.x core/modules/views/tests/src/Functional/Plugin/AccessTest.php \Drupal\Tests\views\Functional\Plugin\AccessTest::setUp()
Overrides KernelTestBase::setUp
File
-
core/
modules/ file/ tests/ src/ Kernel/ AccessTest.php, line 47
Class
- AccessTest
- Tests for the File access control.
Namespace
Drupal\Tests\file\KernelCode
protected function setUp() {
parent::setUp();
$this->installEntitySchema('file');
$this->installEntitySchema('user');
$this->installSchema('file', [
'file_usage',
]);
$this->installSchema('system', 'sequences');
$this->user1 = User::create([
'name' => 'user1',
'status' => 1,
]);
$this->user1
->save();
$this->user2 = User::create([
'name' => 'user2',
'status' => 1,
]);
$this->user2
->save();
$this->file = File::create([
'uid' => $this->user1
->id(),
'filename' => 'druplicon.txt',
'filemime' => 'text/plain',
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.