Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / dblog / tests / src / Functional / Update / DblogNoLogsAvailableUpgradeTest.php
diff --git a/web/core/modules/dblog/tests/src/Functional/Update/DblogNoLogsAvailableUpgradeTest.php b/web/core/modules/dblog/tests/src/Functional/Update/DblogNoLogsAvailableUpgradeTest.php
new file mode 100644 (file)
index 0000000..5002f25
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+
+namespace Drupal\Tests\dblog\Functional\Update;
+
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
+use Drupal\views\Views;
+
+/**
+ * Test the upgrade path of changing the empty text area for watchdog view.
+ *
+ * @see dblog_update_8600()
+ *
+ * @group Update
+ * @group legacy
+ */
+class DblogNoLogsAvailableUpgradeTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
+    ];
+  }
+
+  /**
+   * Tests that no logs available text is now using a custom area.
+   */
+  public function testDblogUpgradePath() {
+
+    $this->runUpdates();
+
+    $view = Views::getView('watchdog');
+    $data = $view->storage->toArray();
+    $area = $data['display']['default']['display_options']['empty']['area'];
+
+    $this->assertEqual('text_custom', $area['plugin_id']);
+    $this->assertEqual('area_text_custom', $area['field']);
+    $this->assertEqual('No log messages available.', $area['content']);
+  }
+
+}