MDL-32547 unit tests: Make tests match file_temp_cleanup_task impl.

While default value did not change from 7 days... there are subtle
differences between strtotime('-1 week') used in tests and
-(7*24**3600) used in implementation.

This just makes the unit test to follow the implementation by
using the new config setting.
This commit is contained in:
Eloy Lafuente (stronk7) 2015-03-31 01:53:56 +02:00
parent 68632b6d80
commit 02badbb0e6

View File

@ -43,7 +43,7 @@ class cronlib_testcase extends basic_testcase {
$time = 0;
// Relative time stamps. Did you know data providers get executed during phpunit init?
$lastweekstime = strtotime('-1 week') - time();
$lastweekstime = -($CFG->tempdatafoldercleanup * 3600); // This must match file_temp_cleanup_task.
$beforelastweekstime = $lastweekstime - 3600 - 1; // At least 1h and 1s diff (make it DST immune).
$afterlastweekstime = $lastweekstime + 3600 + 1; // At least 1h and 1s diff (make it DST immune).