class DbLogViewsTest
Same name and namespace in other branches
- 10 core/modules/dblog/tests/src/Functional/DbLogViewsTest.php \Drupal\Tests\dblog\Functional\DbLogViewsTest
- 11.x core/modules/dblog/tests/src/Functional/DbLogViewsTest.php \Drupal\Tests\dblog\Functional\DbLogViewsTest
- 8.9.x core/modules/dblog/tests/src/Functional/DbLogViewsTest.php \Drupal\Tests\dblog\Functional\DbLogViewsTest
Verifies user access to log reports based on permissions.
@group dblog
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\dblog\Functional\DbLogTest uses \Drupal\Tests\dblog\Functional\FakeLogEntries, \Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\dblog\Functional\DbLogViewsTest extends \Drupal\Tests\dblog\Functional\DbLogTest
- class \Drupal\Tests\dblog\Functional\DbLogTest uses \Drupal\Tests\dblog\Functional\FakeLogEntries, \Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of DbLogViewsTest
See also
Drupal\dblog\Tests\DbLogTest
File
-
core/
modules/ dblog/ tests/ src/ Functional/ DbLogViewsTest.php, line 14
Namespace
Drupal\Tests\dblog\FunctionalView source
class DbLogViewsTest extends DbLogTest {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'dblog',
'node',
'forum',
'help',
'block',
'views',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function getLogsEntriesTable() {
return $this->xpath('.//div[contains(@class, "views-element-container")]//table/tbody/tr');
}
/**
* {@inheritdoc}
*/
protected function filterLogsEntries($type = NULL, $severity = NULL) {
$query = [];
if (isset($type)) {
$query['type[]'] = $type;
}
if (isset($severity)) {
$query['severity[]'] = $severity;
}
$this->drupalGet('admin/reports/dblog', [
'query' => $query,
]);
}
/**
* Tests the empty text for the watchdog view is not using an input format.
*/
public function testEmptyText() {
$view = Views::getView('watchdog');
$data = $view->storage
->toArray();
$area = $data['display']['default']['display_options']['empty']['area'];
$this->assertEquals('text_custom', $area['plugin_id']);
$this->assertEquals('area_text_custom', $area['field']);
$this->assertEquals('No log messages available.', $area['content']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.