1 | <?php |
||
17 | class RemoveOldLogEntriesTaskTest extends SapphireTest |
||
18 | { |
||
19 | /** |
||
20 | * {@inheritDoc} |
||
21 | */ |
||
22 | protected $usesDatabase = true; |
||
23 | |||
24 | /** |
||
25 | * {@inheritDoc} |
||
26 | */ |
||
27 | protected static $fixture_file = 'RemoveOldLogEntriesTaskTest.yml'; |
||
28 | |||
29 | /** |
||
30 | * {@inheritDoc} |
||
31 | */ |
||
32 | public function setUp() |
||
38 | |||
39 | /** |
||
40 | * Test that the configuration properties are set correctly |
||
41 | */ |
||
42 | public function testClassProperties() |
||
49 | |||
50 | /** |
||
51 | * Test that the max log age, cron schedule and cron enabled can be set via YAML configuration |
||
52 | * |
||
53 | * @dataProvider configurableSettingsProvider |
||
54 | */ |
||
55 | public function testSettingsAreConfigurable($getter, $setting, $value) |
||
60 | |||
61 | /** |
||
62 | * @return array[] |
||
63 | */ |
||
64 | public function configurableSettingsProvider() |
||
72 | |||
73 | /** |
||
74 | * Test that when in the cron context and the cron task is disabled that nothing happens |
||
75 | */ |
||
76 | public function testNothingHappensInCronContextIfCronIsDisabled() |
||
91 | |||
92 | /** |
||
93 | * Test that old log entries are removed from the database according to the max age setting |
||
94 | * |
||
95 | * @covers ::removeOldLogs |
||
96 | * @covers ::run |
||
97 | * @covers ::process |
||
98 | */ |
||
99 | public function testRemoveOldLogEntries() |
||
115 | |||
116 | /** |
||
117 | * {@inheritDoc} |
||
118 | */ |
||
119 | public function tearDown() |
||
124 | } |
||
125 |