$this->
installSchema('dblog',
['watchdog'
]);
$this->
installSchema('system',
['sequences'
]);
$this->
installConfig(['system'
]);
} /**
* Tests that cron correctly applies the database log row limit.
*/
public function testDbLogCron() { $row_limit = 100;
// Generate additional log entries.
$this->
generateLogEntries($row_limit + 10
);
// Verify that the database log row count exceeds the row limit.
$count = Database::
getConnection()->
select('watchdog'
)->
countQuery()->
execute()->
fetchField();
$this->
assertGreaterThan($row_limit,
$count,
new FormattableMarkup('Dblog row count of @count exceeds row limit of @limit',
['@count' =>
$count, '@limit' =>
$row_limit]));
// Get the number of enabled modules. Cron adds a log entry for each module.
$implementation_count = 0;
\Drupal::
moduleHandler()->
invokeAllWith( 'cron',
function Dcallable
$hook, string
$module) use (&
$implementation_count) { $implementation_count++;
} );