SilverLeague\LogViewer\Tests\Task\RemoveOldLogEntriesTaskTest
- Author: Robbie Averill <robbie@averill.co.nz>
Synopsis
class RemoveOldLogEntriesTaskTest
extends SapphireTest
{
- // members
- protected boolean $usesDatabase = true;
- protected static string $fixture_file = 'RemoveOldLogEntriesTaskTest.yml';
- // methods
- public void testClassProperties()
- public void testSettingsAreConfigurable()
- public array configurableSettingsProvider()
- public void testNothingHappensInCronContextIfCronIsDisabled()
- public void testRemoveOldLogEntries()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Members
protected
-
$fixture_file
{@inheritDoc} -
$usesDatabase
{@inheritDoc}
Methods
public
- configurableSettingsProvider()
- testClassProperties() — Test that the configuration properties are set correctly
- testNothingHappensInCronContextIfCronIsDisabled() — Test that when in the cron context and the cron task is disabled that nothing happens
- testRemoveOldLogEntries() — Test that old log entries are removed from the database according to the max age setting. The actual date used for checking is gathered from the SQL server inside the query, so we can't really mock it - using 1 day and a new record created now instead.
- testSettingsAreConfigurable() — Test that the max log age, cron schedule and cron enabled can be set via YAML configuration