Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / file / tests / src / Functional / Update / FileUsageTemporaryDeletionConfigurationUpdateTest.php
diff --git a/web/core/modules/file/tests/src/Functional/Update/FileUsageTemporaryDeletionConfigurationUpdateTest.php b/web/core/modules/file/tests/src/Functional/Update/FileUsageTemporaryDeletionConfigurationUpdateTest.php
new file mode 100644 (file)
index 0000000..1f685be
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+namespace Drupal\Tests\file\Functional\Update;
+
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
+
+/**
+ * Tests the upgrade path for setting the file usage deletion configuration.
+ *
+ * @see https://www.drupal.org/node/2801777
+ *
+ * @group Update
+ */
+class FileUsageTemporaryDeletionConfigurationUpdateTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $modules = ['file'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
+    ];
+  }
+
+  /**
+   * Tests that make_unused_managed_files_temporary conditions are correct.
+   *
+   * Verify that the before and after conditions for the variable are correct.
+   */
+  public function testUpdateHookN() {
+    $this->assertIdentical($this->config('file.settings')->get('make_unused_managed_files_temporary'), NULL);
+    $this->runUpdates();
+    $this->assertIdentical($this->config('file.settings')->get('make_unused_managed_files_temporary'), FALSE);
+    $this->assertResponse('200');
+  }
+
+}