comparison core/modules/dblog/tests/src/Functional/DbLogViewsTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
1 <?php 1 <?php
2 2
3 namespace Drupal\Tests\dblog\Functional; 3 namespace Drupal\Tests\dblog\Functional;
4 4
5 use Drupal\filter\Entity\FilterFormat; 5 use Drupal\views\Views;
6 6
7 /** 7 /**
8 * Generate events and verify dblog entries; verify user access to log reports 8 * Generate events and verify dblog entries; verify user access to log reports
9 * based on permissions. Using the dblog UI generated by a View. 9 * based on permissions. Using the dblog UI generated by a View.
10 * 10 *
42 42
43 $this->drupalGet('admin/reports/dblog', ['query' => $query]); 43 $this->drupalGet('admin/reports/dblog', ['query' => $query]);
44 } 44 }
45 45
46 /** 46 /**
47 * {@inheritdoc} 47 * Tests the empty text for the watchdog view is not using an input format.
48 */ 48 */
49 public function testDBLogAddAndClear() { 49 public function testEmptyText() {
50 // Is necesary to create the basic_html format because if absent after 50 $view = Views::getView('watchdog');
51 // delete the logs, a new log entry is created indicating that basic_html 51 $data = $view->storage->toArray();
52 // format do not exists. 52 $area = $data['display']['default']['display_options']['empty']['area'];
53 $basic_html_format = FilterFormat::create([
54 'format' => 'basic_html',
55 'name' => 'Basic HTML',
56 'filters' => [
57 'filter_html' => [
58 'status' => 1,
59 'settings' => [
60 'allowed_html' => '<p> <br> <strong> <a> <em>',
61 ],
62 ],
63 ],
64 ]);
65 $basic_html_format->save();
66 53
67 parent::testDBLogAddAndClear(); 54 $this->assertEqual('text_custom', $area['plugin_id']);
55 $this->assertEqual('area_text_custom', $area['field']);
56 $this->assertEqual('No log messages available.', $area['content']);
68 } 57 }
69 58
70 } 59 }