]> source.dussan.org Git - nextcloud-server.git/commitdiff
Simple fix for the wrong Mapper reset
authorJoas Schilling <nickvergessen@gmx.de>
Tue, 18 Nov 2014 11:35:44 +0000 (12:35 +0100)
committerJoas Schilling <nickvergessen@gmx.de>
Wed, 19 Nov 2014 09:06:15 +0000 (10:06 +0100)
lib/private/files/storage/mappedlocal.php
tests/testcleanuplistener.php

index ea4deaa66e84e1cfba2472035242ed4d6aa4ebd4..4ff02d2952348149e85c6e7a8be9eb7ba260de5f 100644 (file)
@@ -24,9 +24,6 @@ class MappedLocal extends \OC\Files\Storage\Common {
        }
 
        public function __destruct() {
-               if (defined('PHPUNIT_RUN')) {
-                       $this->mapper->removePath($this->datadir, true, true);
-               }
        }
 
        public function getId() {
index fe4fef61ab5e0b4505841694f3bb110f0194e7c8..1ef5a4cfd5d64676a3f8afd301a6e0f8fc7990b2 100644 (file)
@@ -100,6 +100,12 @@ class TestCleanupListener implements PHPUnit_Framework_TestListener {
                        '.' => true
                );
                $datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data');
+
+               if (\OC_Util::runningOnWindows()) {
+                       $mapper = new \OC\Files\Mapper($datadir);
+                       $mapper->removePath($datadir, true, true);
+               }
+
                $entries = array();
                if ($dh = opendir($datadir)) {
                        while (($file = readdir($dh)) !== false) {