3 namespace Drupal\Tests\dblog\Functional;
5 use Drupal\views\Views;
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]);
47 * Tests the empty text for the watchdog view is not using an input format.
49 public function testEmptyText() {
50 $view = Views::getView('watchdog');
51 $data = $view->storage->toArray();
52 $area = $data['display']['default']['display_options']['empty']['area'];
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']);