From db72270acc2ef8dcf1b04ec5e7ed8ce3fb38d81c Mon Sep 17 00:00:00 2001 From: Clark Tomlinson Date: Mon, 22 Sep 2014 10:13:46 -0400 Subject: [PATCH 1/3] fixing directory seperators --- lib/private/helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/helper.php b/lib/private/helper.php index f696b5a890..1297d356d0 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -630,10 +630,10 @@ class OC_Helper { * temporary files are automatically cleaned up after the script is finished */ public static function tmpFolder() { - $path = get_temp_dir() . '/' . md5(time() . rand()); + $path = get_temp_dir() . DIRECTORY_SEPARATOR . md5(time() . rand()); mkdir($path); self::$tmpFiles[] = $path; - return $path . '/'; + return $path . DIRECTORY_SEPARATOR; } /** From 7b6aa3cd3dd57b0415f8a81ace27bed078bab728 Mon Sep 17 00:00:00 2001 From: Clark Tomlinson Date: Mon, 22 Sep 2014 13:38:46 -0400 Subject: [PATCH 2/3] fixing cache routes --- tests/lib/cache/file.php | 6 +++--- tests/lib/cache/usercache.php | 5 ++--- tests/lib/largefilehelpergetfilesize.php | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/lib/cache/file.php b/tests/lib/cache/file.php index 3767c83fcb..0e19c105cd 100644 --- a/tests/lib/cache/file.php +++ b/tests/lib/cache/file.php @@ -46,8 +46,8 @@ class FileCache extends \Test_Cache { $storage = new \OC\Files\Storage\Temporary(array()); \OC\Files\Filesystem::mount($storage,array(),'/'); $datadir = str_replace('local::', '', $storage->getId()); - $this->datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT.'/data'); - \OC_Config::setValue('datadirectory', $datadir); + $this->datadir = \OC_Config::getValue('cachedirectory', \OC::$SERVERROOT.'/data/cache'); + \OC_Config::setValue('cachedirectory', $datadir); \OC_User::clearBackends(); \OC_User::useBackend(new \OC_User_Dummy()); @@ -67,6 +67,6 @@ class FileCache extends \Test_Cache { public function tearDown() { \OC_User::setUserId($this->user); - \OC_Config::setValue('datadirectory', $this->datadir); + \OC_Config::setValue('cachedirectory', $this->datadir); } } diff --git a/tests/lib/cache/usercache.php b/tests/lib/cache/usercache.php index 21b7f848ab..a1b6af1c55 100644 --- a/tests/lib/cache/usercache.php +++ b/tests/lib/cache/usercache.php @@ -42,8 +42,8 @@ class UserCache extends \Test_Cache { $storage = new \OC\Files\Storage\Temporary(array()); \OC\Files\Filesystem::mount($storage,array(),'/'); $datadir = str_replace('local::', '', $storage->getId()); - $this->datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT.'/data'); - \OC_Config::setValue('datadirectory', $datadir); + $this->datadir = \OC_Config::getValue('cachedirectory', \OC::$SERVERROOT.'/data/cache'); + \OC_Config::setValue('cachedirectory', $datadir); \OC_User::clearBackends(); \OC_User::useBackend(new \OC_User_Dummy()); @@ -63,6 +63,5 @@ class UserCache extends \Test_Cache { public function tearDown() { \OC_User::setUserId($this->user); - \OC_Config::setValue('datadirectory', $this->datadir); } } diff --git a/tests/lib/largefilehelpergetfilesize.php b/tests/lib/largefilehelpergetfilesize.php index 86ce6d295c..21a0aa9a23 100644 --- a/tests/lib/largefilehelpergetfilesize.php +++ b/tests/lib/largefilehelpergetfilesize.php @@ -19,7 +19,8 @@ class LargeFileHelperGetFileSize extends \PHPUnit_Framework_TestCase { public function setUp() { parent::setUp(); - $this->filename = __DIR__ . '/../data/data.tar.gz'; + $ds = DIRECTORY_SEPARATOR; + $this->filename = dirname(__DIR__) . "{$ds}data{$ds}data.tar.gz"; $this->fileSize = 4195; $this->helper = new \OC\LargeFileHelper; } From 59a5df6a4bb81b0350090fc5f28677d239910379 Mon Sep 17 00:00:00 2001 From: Clark Tomlinson Date: Mon, 22 Sep 2014 14:13:30 -0400 Subject: [PATCH 3/3] ignoring writedata test in windows. --- tests/lib/config.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/lib/config.php b/tests/lib/config.php index c67a66c832..f739df3ce9 100644 --- a/tests/lib/config.php +++ b/tests/lib/config.php @@ -79,6 +79,9 @@ class Test_Config extends PHPUnit_Framework_TestCase { * @expectedException \OC\HintException */ public function testWriteData() { + if (\OC_Util::runningOnWindows()) { + throw new \OC\HintException('this is ireelevent for windows'); + } $config = new OC\Config('/non-writable'); $config->setValue('foo', 'bar'); }