From 02badbb0e6b558c05fd105af6d0db449c223942a Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Tue, 31 Mar 2015 01:53:56 +0200 Subject: [PATCH] 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. --- lib/tests/cronlib_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tests/cronlib_test.php b/lib/tests/cronlib_test.php index 66b33a99dcd..47ee55cd736 100644 --- a/lib/tests/cronlib_test.php +++ b/lib/tests/cronlib_test.php @@ -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). -- 2.43.0