Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / dblog / tests / src / Functional / Update / DblogRecentLogsUsingViewsUpdateTest.php
diff --git a/web/core/modules/dblog/tests/src/Functional/Update/DblogRecentLogsUsingViewsUpdateTest.php b/web/core/modules/dblog/tests/src/Functional/Update/DblogRecentLogsUsingViewsUpdateTest.php
new file mode 100644 (file)
index 0000000..851c15e
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\Tests\dblog\Functional\Update;
+
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
+
+/**
+ * Ensures that update hook that creates the watchdog view ran sucessfully.
+ *
+ * @group Update
+ */
+class DblogRecentLogsUsingViewsUpdateTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
+    ];
+  }
+
+  /**
+   * Ensures that update hook is run for dblog module.
+   */
+  public function testUpdate() {
+    // Make sure the watchog view doesn't exist before the updates.
+    $view = \Drupal::entityTypeManager()->getStorage('view')->load('watchdog');
+    $this->assertNull($view);
+
+    $this->runUpdates();
+
+    // Ensure the watchdog view is present after run updates.
+    $view = \Drupal::entityTypeManager()->getStorage('view')->load('watchdog');
+    $displays = $view->get('display');
+
+    $this->assertIdentical($displays['page']['display_options']['path'], 'admin/reports/dblog', 'Recent logs message view exists.');
+  }
+
+}