3 namespace Drupal\Tests\dblog\Functional;
5 use Drupal\filter\Entity\FilterFormat;
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.
11 * @see Drupal\dblog\Tests\DbLogTest
15 class DbLogViewsTest extends DbLogTest {
22 public static $modules = ['dblog', 'node', 'forum', 'help', 'block', 'views'];
27 protected function getLogsEntriesTable() {
28 return $this->xpath('.//table[contains(@class, "views-view-table")]/tbody/tr');
34 protected function filterLogsEntries($type = NULL, $severity = NULL) {
37 $query['type[]'] = $type;
39 if (isset($severity)) {
40 $query['severity[]'] = $severity;
43 $this->drupalGet('admin/reports/dblog', ['query' => $query]);
49 public function testDBLogAddAndClear() {
50 // Is necesary to create the basic_html format because if absent after
51 // delete the logs, a new log entry is created indicating that basic_html
52 // format do not exists.
53 $basic_html_format = FilterFormat::create([
54 'format' => 'basic_html',
55 'name' => 'Basic HTML',
60 'allowed_html' => '<p> <br> <strong> <a> <em>',
65 $basic_html_format->save();
67 parent::testDBLogAddAndClear();