protected function FileResourceTestBase::makeCurrentUserFileOwner in Drupal 10
Same name and namespace in other branches
- 8 core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::makeCurrentUserFileOwner()
- 9 core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::makeCurrentUserFileOwner()
Makes the current user the file owner.
1 call to FileResourceTestBase::makeCurrentUserFileOwner()
- FileResourceTestBase::setUpAuthorization in core/
modules/ file/ tests/ src/ Functional/ Rest/ FileResourceTestBase.php - Sets up the necessary authorization.
File
- core/
modules/ file/ tests/ src/ Functional/ Rest/ FileResourceTestBase.php, line 65
Class
Namespace
Drupal\Tests\file\Functional\RestCode
protected function makeCurrentUserFileOwner() {
$account = static::$auth ? User::load(2) : User::load(0);
$this->entity
->setOwnerId($account
->id());
$this->entity
->setOwner($account);
$this->entity
->save();
}