function RevisionRevertFormTest::getLogs
Same name in other branches
- 11.x core/tests/Drupal/FunctionalTests/Entity/RevisionRevertFormTest.php \Drupal\FunctionalTests\Entity\RevisionRevertFormTest::getLogs()
Loads watchdog entries by channel.
Parameters
string $channel: The logger channel.
Return value
string[] Watchdog entries.
1 call to RevisionRevertFormTest::getLogs()
- RevisionRevertFormTest::testSubmitForm in core/
tests/ Drupal/ FunctionalTests/ Entity/ RevisionRevertFormTest.php - Tests revision revert, and expected response after revert.
File
-
core/
tests/ Drupal/ FunctionalTests/ Entity/ RevisionRevertFormTest.php, line 349
Class
- RevisionRevertFormTest
- Tests reverting a revision with revision revert form.
Namespace
Drupal\FunctionalTests\EntityCode
protected function getLogs(string $channel) : array {
$logs = \Drupal::database()->query("SELECT * FROM {watchdog} WHERE type = :type", [
':type' => $channel,
])
->fetchAll();
return array_map(function (object $log) {
return (string) new FormattableMarkup($log->message, unserialize($log->variables));
}, $logs);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.