From: Thomas Müller Date: Sat, 9 Feb 2013 18:03:03 +0000 (+0100) Subject: make MappedLocal available and testable within Linux as well X-Git-Tag: v5.0.0alpha1^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8174e5faf18fcd762efce5ffdfabfa1102580dd5;p=nextcloud-server.git make MappedLocal available and testable within Linux as well --- diff --git a/lib/files/storage/local.php b/lib/files/storage/local.php index d387a898320..038d68bf46b 100644 --- a/lib/files/storage/local.php +++ b/lib/files/storage/local.php @@ -9,7 +9,9 @@ namespace OC\Files\Storage; if (\OC_Util::runningOnWindows()) { - require_once 'mappedlocal.php'; + class Local extends MappedLocal { + + } } else { /** diff --git a/lib/files/storage/mappedlocal.php b/lib/files/storage/mappedlocal.php index 80dd79bc41f..411b053737a 100644 --- a/lib/files/storage/mappedlocal.php +++ b/lib/files/storage/mappedlocal.php @@ -10,7 +10,7 @@ namespace OC\Files\Storage; /** * for local filestore, we only have to map the paths */ -class Local extends \OC\Files\Storage\Common{ +class MappedLocal extends \OC\Files\Storage\Common{ protected $datadir; private $mapper; diff --git a/tests/lib/files/storage/mappedlocal.php b/tests/lib/files/storage/mappedlocal.php new file mode 100644 index 00000000000..b483f3a1954 --- /dev/null +++ b/tests/lib/files/storage/mappedlocal.php @@ -0,0 +1,40 @@ +. +* +*/ + +namespace Test\Files\Storage; + +class MappedLocal extends Storage { + /** + * @var string tmpDir + */ + private $tmpDir; + public function setUp() { + $this->tmpDir=\OC_Helper::tmpFolder(); + $this->instance=new \OC\Files\Storage\MappedLocal(array('datadir'=>$this->tmpDir)); + } + + public function tearDown() { + \OC_Helper::rmdirr($this->tmpDir); + unset($this->instance); + } +} +