Skip to content
Snippets Groups Projects
Verified Commit dd994edd 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 99b53d92
No related branches found
No related tags found
17 merge requests!10663Issue #3495778: Update phpdoc in FileSaveHtaccessLoggingTest,!10451Issue #3472458 by watergate, smustgrave: CKEditor 5 show blocks label is not translated,!103032838547 Fix punctuation rules for inline label suffix colon with CSS only,!10150Issue #3467294 by quietone, nod_, smustgrave, catch, longwave: Change string...,!10130Resolve #3480321 "Second level menu",!9936Issue #3483087: Check the module:// prefix in the translation server path and replace it with the actual module path,!9933Issue #3394728 by ankondrat4: Undefined array key "#prefix" and deprecated function: explode() in Drupal\file\Element\ManagedFile::uploadAjaxCallback(),!9914Issue #3451136 by quietone, gapple, ghost of drupal past: Improve...,!9882Draft: Issue #3481777 In bulk_form ensure the triggering element is the bulk_form button,!9839Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9815Issue #3480025: There is no way to remove entity cache items,!9757Issue #3478869 Add "All" or overview links to parent links,!9752Issue #3439910 by pooja_sharma, vensires: Fix Toolbar tests that rely on UID1's super user behavior,!9749Issue #3439910 by pooja_sharma, vensires: Fix Toolbar tests that rely on UID1's super user behavior,!9678Issue #3465132 by catch, Spokje, nod_: Show test run time by class in run-tests.sh output,!9578Issue #3304746 by scott_euser, casey, smustgrave: BigPipe cannot handle (GET)...,!9449Issue #3344041: Allow textarea widgets to be used for text (formatted) fields
Pipeline #237198 passed
Pipeline: drupal

#237220

    Pipeline: drupal

    #237214

      Pipeline: drupal

      #237204

        ...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
        namespace Drupal\Tests\file\Kernel; namespace Drupal\Tests\file\Kernel;
        use Drupal\file\Entity\File; use Drupal\file\Entity\File;
        use Drupal\Tests\user\Traits\UserCreationTrait;
        /** /**
        * File saving tests. * File saving tests.
        ...@@ -13,18 +14,13 @@ ...@@ -13,18 +14,13 @@
        */ */
        class SaveTest extends FileManagedUnitTestBase { class SaveTest extends FileManagedUnitTestBase {
        /** use UserCreationTrait;
        * {@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;
        public function testFileSave(): void { public function testFileSave(): void {
        $account = $this->createUser();
        // Create a new file entity. // Create a new file entity.
        $file = File::create([ $file = File::create([
        'uid' => 1, 'uid' => $account->id(),
        'filename' => 'druplicon.txt', 'filename' => 'druplicon.txt',
        'uri' => 'public://druplicon.txt', 'uri' => 'public://druplicon.txt',
        'filemime' => 'text/plain', 'filemime' => 'text/plain',
        ...@@ -67,7 +63,7 @@ public function testFileSave(): void { ...@@ -67,7 +63,7 @@ public function testFileSave(): void {
        // Try to insert a second file with the same name apart from case insensitivity // 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. // to ensure the 'uri' index allows for filenames with different cases.
        $uppercase_values = [ $uppercase_values = [
        'uid' => 1, 'uid' => $account->id(),
        'filename' => 'DRUPLICON.txt', 'filename' => 'DRUPLICON.txt',
        'uri' => 'public://DRUPLICON.txt', 'uri' => 'public://DRUPLICON.txt',
        'filemime' => 'text/plain', 'filemime' => 'text/plain',
        ...@@ -96,7 +92,7 @@ public function testFileSave(): void { ...@@ -96,7 +92,7 @@ public function testFileSave(): void {
        // Save a file with zero bytes. // Save a file with zero bytes.
        $file = File::create([ $file = File::create([
        'uid' => 1, 'uid' => $account->id(),
        'filename' => 'no-druplicon.txt', 'filename' => 'no-druplicon.txt',
        'uri' => 'public://no-druplicon.txt', 'uri' => 'public://no-druplicon.txt',
        'filemime' => 'text/plain', 'filemime' => 'text/plain',
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment