diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module index a0afcd4..5318a34 100644 --- a/core/modules/dblog/dblog.module +++ b/core/modules/dblog/dblog.module @@ -136,7 +136,7 @@ function _dblog_get_message_types() { $types[] = $object->type; } - return $types; + return drupal_map_assoc($types); } /** @@ -196,3 +196,22 @@ function dblog_theme() { ), ); } + +/** + * Provides a mapping between the severity constants and a readable version. + * + * @return array + * An assosiative array with the severity constant as key and ... as value. + */ +function dblog_views_severity_options_callback() { + return array( + WATCHDOG_DEBUG => 'dblog-debug', + WATCHDOG_INFO => 'dblog-info', + WATCHDOG_NOTICE => 'dblog-notice', + WATCHDOG_WARNING => 'dblog-warning', + WATCHDOG_ERROR => 'dblog-error', + WATCHDOG_CRITICAL => 'dblog-critical', + WATCHDOG_ALERT => 'dblog-alert', + WATCHDOG_EMERGENCY => 'dblog-emergency', + ); +} diff --git a/core/modules/dblog/dblog.views.inc b/core/modules/dblog/dblog.views.inc index a121a57..3822974 100644 --- a/core/modules/dblog/dblog.views.inc +++ b/core/modules/dblog/dblog.views.inc @@ -2,7 +2,7 @@ /** * @file - * Provide views data and ids for dblog.module. + * Provide views data for dblog.module. * * @ingroup views_module_ids */ diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php index 41baf5e..8e614c1 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php +++ b/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php @@ -7,13 +7,13 @@ namespace Drupal\dblog\Tests\Views; -use Drupal\views\Tests\ViewTestBase; use Drupal\views\Tests\ViewTestData; +use Drupal\views\Tests\ViewUnitTestBase; /** * Tests the views integration of dblog module. */ -class ViewsIntegrationTest extends ViewTestBase { +class ViewsIntegrationTest extends ViewUnitTestBase { /** * Views used by this test. @@ -27,7 +27,7 @@ class ViewsIntegrationTest extends ViewTestBase { * * @var array */ - public static $modules = array('dblog', 'dblog_test_views', 'views'); + public static $modules = array('dblog', 'dblog_test_views', 'views', 'system'); public static function getInfo() { return array( @@ -40,6 +40,9 @@ public static function getInfo() { protected function setUp() { parent::setUp(); + $this->installSchema('system', 'cache_path'); + $this->installSchema('dblog', 'watchdog'); + ViewTestData::importTestViews(get_class($this), array('dblog_test_views')); } @@ -62,7 +65,6 @@ public function testIntegration() { $view = views_get_view('test_dblog'); $this->executeView($view); - debug($view->result); } }