Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / dblog / tests / src / Functional / DbLogViewsTest.php
index d04d9ba15428af7c51be0e33d5ef1ff627d3f115..6e525cdf6f9dfe748dc91c5c02694637384eef6d 100644 (file)
@@ -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 @@ class DbLogViewsTest extends DbLogTest {
   }
 
   /**
-   * {@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();
-
-    parent::testDBLogAddAndClear();
+  public function testEmptyText() {
+    $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']);
   }
 
 }