diff core/modules/dblog/tests/src/Functional/DbLogViewsTest.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
line wrap: on
line diff
--- a/core/modules/dblog/tests/src/Functional/DbLogViewsTest.php	Thu Feb 28 11:14:44 2019 +0000
+++ b/core/modules/dblog/tests/src/Functional/DbLogViewsTest.php	Thu Feb 28 13:11:55 2019 +0000
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\dblog\Functional;
 
-use Drupal\filter\Entity\FilterFormat;
+use Drupal\views\Views;
 
 /**
  * Generate events and verify dblog entries; verify user access to log reports
@@ -44,27 +44,16 @@
   }
 
   /**
-   * {@inheritdoc}
+   * Tests the empty text for the watchdog view is not using an input format.
    */
-  public function testDBLogAddAndClear() {
-    // Is necesary to create the basic_html format because if absent after
-    // delete the logs, a new log entry is created indicating that basic_html
-    // format do not exists.
-    $basic_html_format = FilterFormat::create([
-      'format' => 'basic_html',
-      'name' => 'Basic HTML',
-      'filters' => [
-        'filter_html' => [
-          'status' => 1,
-          'settings' => [
-            'allowed_html' => '<p> <br> <strong> <a> <em>',
-          ],
-        ],
-      ],
-    ]);
-    $basic_html_format->save();
+  public function testEmptyText() {
+    $view = Views::getView('watchdog');
+    $data = $view->storage->toArray();
+    $area = $data['display']['default']['display_options']['empty']['area'];
 
-    parent::testDBLogAddAndClear();
+    $this->assertEqual('text_custom', $area['plugin_id']);
+    $this->assertEqual('area_text_custom', $area['field']);
+    $this->assertEqual('No log messages available.', $area['content']);
   }
 
 }