From 3879943ddef36d3f4368e4375314301b31b6d7d2 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Fri, 31 Oct 2014 16:07:47 +0800 Subject: [PATCH] MDL-45204 phpunit: Fixed test_localcachedir test make_localcache_directory is the first call to make localcache, which is already created by reset. So deleting existing localcache directory will pass this test --- lib/tests/setuplib_test.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tests/setuplib_test.php b/lib/tests/setuplib_test.php index a17971deabceb..f1f999d5c38b8 100644 --- a/lib/tests/setuplib_test.php +++ b/lib/tests/setuplib_test.php @@ -155,6 +155,9 @@ public function test_localcachedir() { $this->setCurrentTimeStart(); $timestampfile = "$CFG->localcachedir/.lastpurged"; + // Delete existing localcache directory, as this is testing first call + // to make_localcache_directory. + remove_dir($CFG->localcachedir, true); $dir = make_localcache_directory('', false); $this->assertSame($CFG->localcachedir, $dir); $this->assertFileNotExists("$CFG->localcachedir/.htaccess");