Loading core/modules/file/tests/src/Kernel/SaveTest.php +6 −10 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Drupal\Tests\file\Kernel; use Drupal\file\Entity\File; use Drupal\Tests\user\Traits\UserCreationTrait; /** * File saving tests. Loading @@ -13,18 +14,13 @@ */ class SaveTest extends FileManagedUnitTestBase { /** * {@inheritdoc} * * @todo Remove and fix test to not rely on super user. * @see https://www.drupal.org/project/drupal/issues/3437620 */ protected bool $usesSuperUserAccessPolicy = TRUE; use UserCreationTrait; public function testFileSave(): void { $account = $this->createUser(); // Create a new file entity. $file = File::create([ 'uid' => 1, 'uid' => $account->id(), 'filename' => 'druplicon.txt', 'uri' => 'public://druplicon.txt', 'filemime' => 'text/plain', Loading Loading @@ -67,7 +63,7 @@ public function testFileSave(): void { // Try to insert a second file with the same name apart from case insensitivity // to ensure the 'uri' index allows for filenames with different cases. $uppercase_values = [ 'uid' => 1, 'uid' => $account->id(), 'filename' => 'DRUPLICON.txt', 'uri' => 'public://DRUPLICON.txt', 'filemime' => 'text/plain', Loading Loading @@ -96,7 +92,7 @@ public function testFileSave(): void { // Save a file with zero bytes. $file = File::create([ 'uid' => 1, 'uid' => $account->id(), 'filename' => 'no-druplicon.txt', 'uri' => 'public://no-druplicon.txt', 'filemime' => 'text/plain', Loading Loading
core/modules/file/tests/src/Kernel/SaveTest.php +6 −10 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Drupal\Tests\file\Kernel; use Drupal\file\Entity\File; use Drupal\Tests\user\Traits\UserCreationTrait; /** * File saving tests. Loading @@ -13,18 +14,13 @@ */ class SaveTest extends FileManagedUnitTestBase { /** * {@inheritdoc} * * @todo Remove and fix test to not rely on super user. * @see https://www.drupal.org/project/drupal/issues/3437620 */ protected bool $usesSuperUserAccessPolicy = TRUE; use UserCreationTrait; public function testFileSave(): void { $account = $this->createUser(); // Create a new file entity. $file = File::create([ 'uid' => 1, 'uid' => $account->id(), 'filename' => 'druplicon.txt', 'uri' => 'public://druplicon.txt', 'filemime' => 'text/plain', Loading Loading @@ -67,7 +63,7 @@ public function testFileSave(): void { // Try to insert a second file with the same name apart from case insensitivity // to ensure the 'uri' index allows for filenames with different cases. $uppercase_values = [ 'uid' => 1, 'uid' => $account->id(), 'filename' => 'DRUPLICON.txt', 'uri' => 'public://DRUPLICON.txt', 'filemime' => 'text/plain', Loading Loading @@ -96,7 +92,7 @@ public function testFileSave(): void { // Save a file with zero bytes. $file = File::create([ 'uid' => 1, 'uid' => $account->id(), 'filename' => 'no-druplicon.txt', 'uri' => 'public://no-druplicon.txt', 'filemime' => 'text/plain', Loading