Drupal 8  8.0.2
DbLogTest Class Reference
Inheritance diagram for DbLogTest:

Public Member Functions

 testDbLog ()
 
 verifySort ($sort= 'asc', $order= 'Date')
 
 testDBLogAddAndClear ()
 
 testFilter ()
 
 testTemporaryUser ()
 
 testOverviewLinks ()
 
- Public Member Functions inherited from WebTestBase
 __construct ($test_id=NULL)
 
 drupalGetNodeByTitle ($title, $reset=FALSE)
 
- Public Member Functions inherited from TestBase
 __construct ($test_id=NULL)
 
 run (array $methods=array())
 
 errorHandler ($severity, $message, $file=NULL, $line=NULL)
 
 configImporter ()
 
 copyConfig (StorageInterface $source_storage, StorageInterface $target_storage)
 
 getDatabasePrefix ()
 
 getTempFilesDirectory ()
 

Static Public Attributes

static $modules = array('dblog', 'node', 'forum', 'help', 'block')
 

Protected Member Functions

 setUp ()
 
 getLogEntries ()
 
 getTypeCount (array $types)
 
 getSeverityConstant ($class)
 
 asText (\SimpleXMLElement $element)
 
 assertLogMessage ($log_message, $message)
 
- Protected Member Functions inherited from WebTestBase
 drupalCreateNode (array $settings=array())
 
 drupalCreateContentType (array $values=array())
 
 drupalBuildEntityView (EntityInterface $entity, $view_mode= 'full', $langcode=NULL, $reset=FALSE)
 
 drupalPlaceBlock ($plugin_id, array $settings=array())
 
 assertBlockAppears (Block $block)
 
 assertNoBlockAppears (Block $block)
 
 findBlockInstance (Block $block)
 
 drupalGetTestFiles ($type, $size=NULL)
 
 drupalCompareFiles ($file1, $file2)
 
 drupalLogin (AccountInterface $account)
 
 drupalUserIsLoggedIn ($account)
 
 drupalLogout ()
 
 setUp ()
 
 doInstall ()
 
 prepareSettings ()
 
 initSettings ()
 
 initConfig (ContainerInterface $container)
 
 rebuildAll ()
 
 installParameters ()
 
 setBatch ()
 
 restoreBatch ()
 
 initUserSession ()
 
 initKernel (Request $request)
 
 addCustomTranslations ($langcode, array $values)
 
 writeCustomTranslations ()
 
 rebuildContainer ()
 
 resetAll ()
 
 refreshVariables ()
 
 tearDown ()
 
 curlInitialize ()
 
 curlExec ($curl_options, $redirect=FALSE)
 
 curlHeaderCallback ($curlHandler, $header)
 
 curlClose ()
 
 isInChildSite ()
 
 drupalGet ($path, array $options=array(), array $headers=array())
 
 drupalGetJSON ($path, array $options=array(), array $headers=array())
 
 drupalGetWithFormat ($path, $format, array $options=[], array $headers=[])
 
 drupalGetAjax ($path, array $options=array(), array $headers=array())
 
 drupalGetXHR ($path, array $options=array(), array $headers=array())
 
 drupalPostForm ($path, $edit, $submit, array $options=array(), array $headers=array(), $form_html_id=NULL, $extra_post=NULL)
 
 drupalPostAjaxForm ($path, $edit, $triggering_element, $ajax_path=NULL, array $options=array(), array $headers=array(), $form_html_id=NULL, $ajax_settings=NULL)
 
 drupalProcessAjaxResponse ($content, array $ajax_response, array $ajax_settings, array $drupal_settings)
 
 drupalPost ($path, $accept, array $post, $options=array())
 
 drupalPostWithFormat ($path, $format, array $post, $options=[])
 
 getAjaxPageStatePostData ()
 
 serializePostValues ($post=array())
 
 translatePostValues (array $values)
 
 cronRun ()
 
 checkForMetaRefresh ()
 
 drupalHead ($path, array $options=array(), array $headers=array())
 
 handleForm (&$post, &$edit, &$upload, $submit, $form)
 
 clickLink ($label, $index=0)
 
 clickLinkPartialName ($label, $index=0)
 
 clickLinkHelper ($label, $index, $pattern)
 
 getAbsoluteUrl ($path)
 
 drupalGetHeaders ($all_requests=FALSE)
 
 drupalGetHeader ($name, $all_requests=FALSE)
 
 assertHeader ($header, $value, $message= '', $group= 'Browser')
 
 drupalGetMails ($filter=array())
 
 assertUrl ($path, array $options=array(), $message= '', $group= 'Other')
 
 assertResponse ($code, $message= '', $group= 'Browser')
 
 assertNoResponse ($code, $message= '', $group= 'Browser')
 
 assertMail ($name, $value= '', $message= '', $group= 'Email')
 
 assertMailString ($field_name, $string, $email_depth, $message= '', $group= 'Other')
 
 assertMailPattern ($field_name, $regex, $message= '', $group= 'Other')
 
 verboseEmail ($count=1)
 
 prepareRequestForGenerator ($clean_urls=TRUE, $override_server_vars=array())
 
 buildUrl ($path, array $options=array())
 
 assertCacheContext ($expected_cache_context)
 
 assertNoCacheContext ($not_expected_cache_context)
 
 assertCacheTag ($expected_cache_tag)
 
 assertNoCacheTag ($cache_tag)
 
 setHttpResponseDebugCacheabilityHeaders ($value=TRUE)
 
- Protected Member Functions inherited from TestBase
 setUp ()
 
 checkRequirements ()
 
 storeAssertion (array $assertion)
 
 assert ($status, $message= '', $group= 'Other', array $caller=NULL)
 
 getAssertionCall ()
 
 assertTrue ($value, $message= '', $group= 'Other')
 
 assertFalse ($value, $message= '', $group= 'Other')
 
 assertNull ($value, $message= '', $group= 'Other')
 
 assertNotNull ($value, $message= '', $group= 'Other')
 
 assertEqual ($first, $second, $message= '', $group= 'Other')
 
 assertNotEqual ($first, $second, $message= '', $group= 'Other')
 
 assertIdentical ($first, $second, $message= '', $group= 'Other')
 
 assertNotIdentical ($first, $second, $message= '', $group= 'Other')
 
 assertIdenticalObject ($object1, $object2, $message= '', $group= 'Other')
 
 assertNoErrorsLogged ()
 
 assertErrorLogged ($error_message)
 
 pass ($message=NULL, $group= 'Other')
 
 fail ($message=NULL, $group= 'Other')
 
 error ($message= '', $group= 'Other', array $caller=NULL)
 
 verbose ($message)
 
 beforePrepareEnvironment ()
 
 tearDown ()
 
 exceptionHandler ($exception)
 
 settingsSet ($name, $value)
 
 config ($name)
 
 getConfigSchemaExclusions ()
 

Protected Attributes

 $adminUser
 
 $webUser
 
- Protected Attributes inherited from WebTestBase
 $profile = 'testing'
 
 $url
 
 $curlHandle
 
 $assertAjaxHeader = TRUE
 
 $headers
 
 $cookies = array()
 
 $dumpHeaders = FALSE
 
 $loggedInUser = FALSE
 
 $rootUser
 
 $cookieFile = NULL
 
 $additionalCurlOptions = array()
 
 $originalBatch
 
 $originalUser = NULL
 
 $originalShutdownCallbacks = array()
 
 $sessionId = NULL
 
 $generatedTestFiles = FALSE
 
 $maximumRedirects = 5
 
 $redirectCount
 
 $maximumMetaRefreshCount = NULL
 
 $metaRefreshCount = 0
 
 $kernel
 
 $configDirectories = array()
 
 $curlCookies = array()
 
 $customTranslations
 
 $classLoader
 
- Protected Attributes inherited from TestBase
 $testId
 
 $siteDirectory = NULL
 
 $databasePrefix = NULL
 
 $timeLimit = 500
 
 $assertions = array()
 
 $skipClasses = array(__CLASS__ => TRUE)
 
 $verboseId = 0
 
 $verboseClassName
 
 $verboseDirectory
 
 $verboseDirectoryUrl
 
 $originalConf
 
 $originalConfig
 
 $originalConfigDirectories
 
 $originalContainer
 
 $originalFileDirectory = NULL
 
 $originalLanguage
 
 $originalPrefix
 
 $originalProfile
 
 $originalSessionName
 
 $originalSettings
 
 $originalShutdownCallbacks
 
 $originalSite
 
 $originalUser
 
 $publicFilesDirectory
 
 $privateFilesDirectory
 
 $tempFilesDirectory
 
 $translationFilesDirectory
 
 $kernel
 
 $container
 
 $configImporter
 
 $strictConfigSchema = TRUE
 
 $httpAuthMethod = CURLAUTH_BASIC
 
 $httpAuthCredentials = NULL
 

Additional Inherited Members

- Static Public Member Functions inherited from TestBase
static insertAssert ($test_id, $test_class, $status, $message= '', $group= 'Other', array $caller=array())
 
static deleteAssert ($message_id)
 
static getDatabaseConnection ()
 
static generatePermutations ($parameters)
 
static filePreDeleteCallback ($path)
 
- Data Fields inherited from WebTestBase
createRole as drupalCreateRole
 
createAdminRole as drupalCreateAdminRole
 
- Data Fields inherited from TestBase
 $results
 
 $verbose
 
 $dieOnFail = FALSE
 
- Static Protected Attributes inherited from TestBase
static $configSchemaCheckerExclusions
 

Detailed Description

Generate events and verify dblog entries; verify user access to log reports based on permissions.

dblog

Member Function Documentation

assertLogMessage (   $log_message,
  $message 
)
protected

Confirms that a log message appears on the database log overview screen.

This function should only be used for the admin/reports/dblog page, because it checks for the message link text truncated to 56 characters. Other log pages have no detail links so they contain the full message text.

Parameters
string$log_messageThe database log message to check.
string$messageThe message to pass to simpletest.

References Html\decodeEntities(), and Unicode\truncate().

Here is the call graph for this function:

asText ( \SimpleXMLElement  $element)
protected

Extracts the text contained by the XHTML element.

Parameters
\SimpleXMLElement$elementElement to extract text from.
Returns
string Extracted text.

References TestBase\fail().

Referenced by DbLogTest\getLogEntries().

Here is the call graph for this function:

Here is the caller graph for this function:

getLogEntries ( )
protected

Gets the database log event information from the browser page.

Returns
array List of log events where each event is an array with following keys:
  • severity: (int) A database log severity constant.
  • type: (string) The type of database log event.
  • message: (string) The message for this database log event.
  • user: (string) The user associated with this database log event.

References DbLogTest\asText(), and DbLogTest\getSeverityConstant().

Referenced by DbLogTest\getTypeCount().

Here is the call graph for this function:

Here is the caller graph for this function:

getSeverityConstant (   $class)
protected

Gets the watchdog severity constant corresponding to the CSS class.

Parameters
string$classCSS class attribute.
Returns
int|null The watchdog severity constant or NULL if not found.

References DbLogController\getLogLevelClassMap().

Referenced by DbLogTest\getLogEntries().

Here is the call graph for this function:

Here is the caller graph for this function:

getTypeCount ( array  $types)
protected

Gets the count of database log entries by database log event type.

Parameters
array$typesThe type information to compare against.
Returns
array The count of each type keyed by the key of the $types array.

References DbLogTest\getLogEntries().

Referenced by DbLogTest\testFilter().

Here is the call graph for this function:

Here is the caller graph for this function:

setUp ( )
protected

{}

References WebTestBase\drupalPlaceBlock().

Here is the call graph for this function:

testDbLog ( )

Tests Database Logging module functionality through interfaces.

First logs in users, then creates database log events, and finally tests Database Logging module functionality through both the admin and user interfaces.

References WebTestBase\drupalLogin(), and DbLogTest\verifySort().

Here is the call graph for this function:

testDBLogAddAndClear ( )

Tests the addition and clearing of log events through the admin interface.

Logs in the admin user, creates a database log event, and tests the functionality of clearing the database log through the admin interface.

References TestBase\assertEqual(), db_query(), WebTestBase\drupalLogin(), WebTestBase\drupalPostForm(), format_string(), RfcLogLevel\NOTICE, Drupal\request(), and t().

Here is the call graph for this function:

testFilter ( )

Tests the database log filter functionality at admin/reports/dblog.

References TestBase\assertEqual(), WebTestBase\assertResponse(), db_delete(), WebTestBase\drupalGet(), WebTestBase\drupalLogin(), WebTestBase\drupalPostForm(), RfcLogLevel\EMERGENCY, DbLogTest\getTypeCount(), and t().

Here is the call graph for this function:

testOverviewLinks ( )

Make sure HTML tags are filtered out in the log overview links.

References WebTestBase\assertResponse(), WebTestBase\drupalGet(), and WebTestBase\drupalLogin().

Here is the call graph for this function:

testTemporaryUser ( )

Tests that the details page displays correctly for a temporary user.

References WebTestBase\assertResponse(), db_query(), WebTestBase\drupalGet(), and WebTestBase\drupalLogin().

Here is the call graph for this function:

verifySort (   $sort = 'asc',
  $order = 'Date' 
)

Verifies the sorting functionality of the database logging reports table.

Parameters
string$sortThe sort direction.
string$orderThe order by which the table should be sorted.

References WebTestBase\assertResponse(), WebTestBase\drupalGet(), and t().

Referenced by DbLogTest\testDbLog().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: