Skip to content
Snippets Groups Projects
Verified Commit 9eb5ee79 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3439836 by pooja_sharma, thebumik, FeyP, vensires, smustgrave,...

Issue #3439836 by pooja_sharma, thebumik, FeyP, vensires, smustgrave, kim.pepper, quietone: Fix File tests that rely on UID1's super user behavior

(cherry picked from commit 35dbb2d4)
parent d170a1e0
No related branches found
No related tags found
10 merge requests!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #237196 passed
Pipeline: drupal

#237226

    Pipeline: drupal

    #237218

      Pipeline: drupal

      #237212

        +1
        ......@@ -5,6 +5,7 @@
        namespace Drupal\Tests\file\Kernel;
        use Drupal\file\Entity\File;
        use Drupal\Tests\user\Traits\UserCreationTrait;
        /**
        * File saving tests.
        ......@@ -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',
        ......@@ -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',
        ......@@ -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',
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment