]> source.dussan.org Git - nextcloud-server.git/commitdiff
get rid of failing test that don't cause additional downloads
authorRobin Appelman <icewind@owncloud.com>
Fri, 6 Dec 2013 17:26:38 +0000 (18:26 +0100)
committerVincent Petry <pvince81@owncloud.com>
Sat, 7 Dec 2013 23:17:17 +0000 (00:17 +0100)
config/config.sample.php [changed mode: 0644->0755]
tests/lib/files/etagtest.php
tests/lib/files/filesystem.php

old mode 100644 (file)
new mode 100755 (executable)
index 04f79594a294ea6403afd27de06cc494e32e60db..6c41413c4df27a6f9b60bb42f8750c1b157a39b6 100644 (file)
@@ -59,7 +59,7 @@ class EtagTest extends \PHPUnit_Framework_TestCase {
                Filesystem::file_put_contents('/folder/bar.txt', 'fgh');
                Filesystem::file_put_contents('/folder/subfolder/qwerty.txt', 'jkl');
 
-               $files = array('/', '/folder', '/foo.txt', '/folder/bar.txt', '/folder/subfolder', '/folder/subfolder/qwerty.txt');
+               $files = array('/foo.txt', '/folder/bar.txt', '/folder/subfolder', '/folder/subfolder/qwerty.txt');
                $originalEtags = $this->getEtags($files);
 
                $scanner = new \OC\Files\Utils\Scanner($user1);
index 16b9237150a08e482b5afa175edd0512f64ebde2..eb13b5a77b4461373ec8fcee34252a8732261c61 100644 (file)
@@ -26,7 +26,7 @@ class Filesystem extends \PHPUnit_Framework_TestCase {
        /**
         * @var array tmpDirs
         */
-       private $tmpDirs=array();
+       private $tmpDirs = array();
 
        /**
         * @return array
@@ -48,21 +48,21 @@ class Filesystem extends \PHPUnit_Framework_TestCase {
        }
 
        public function testMount() {
-               \OC\Files\Filesystem::mount('\OC\Files\Storage\Local',self::getStorageData(),'/');
-               $this->assertEquals('/',\OC\Files\Filesystem::getMountPoint('/'));
-               $this->assertEquals('/',\OC\Files\Filesystem::getMountPoint('/some/folder'));
-               list( , $internalPath)=\OC\Files\Filesystem::resolvePath('/');
-               $this->assertEquals('',$internalPath);
-               list( , $internalPath)=\OC\Files\Filesystem::resolvePath('/some/folder');
-               $this->assertEquals('some/folder',$internalPath);
-
-               \OC\Files\Filesystem::mount('\OC\Files\Storage\Local',self::getStorageData(),'/some');
-               $this->assertEquals('/',\OC\Files\Filesystem::getMountPoint('/'));
-               $this->assertEquals('/some/',\OC\Files\Filesystem::getMountPoint('/some/folder'));
-               $this->assertEquals('/some/',\OC\Files\Filesystem::getMountPoint('/some/'));
-               $this->assertEquals('/some/',\OC\Files\Filesystem::getMountPoint('/some'));
-               list( , $internalPath)=\OC\Files\Filesystem::resolvePath('/some/folder');
-               $this->assertEquals('folder',$internalPath);
+               \OC\Files\Filesystem::mount('\OC\Files\Storage\Local', self::getStorageData(), '/');
+               $this->assertEquals('/', \OC\Files\Filesystem::getMountPoint('/'));
+               $this->assertEquals('/', \OC\Files\Filesystem::getMountPoint('/some/folder'));
+               list(, $internalPath) = \OC\Files\Filesystem::resolvePath('/');
+               $this->assertEquals('', $internalPath);
+               list(, $internalPath) = \OC\Files\Filesystem::resolvePath('/some/folder');
+               $this->assertEquals('some/folder', $internalPath);
+
+               \OC\Files\Filesystem::mount('\OC\Files\Storage\Local', self::getStorageData(), '/some');
+               $this->assertEquals('/', \OC\Files\Filesystem::getMountPoint('/'));
+               $this->assertEquals('/some/', \OC\Files\Filesystem::getMountPoint('/some/folder'));
+               $this->assertEquals('/some/', \OC\Files\Filesystem::getMountPoint('/some/'));
+               $this->assertEquals('/some/', \OC\Files\Filesystem::getMountPoint('/some'));
+               list(, $internalPath) = \OC\Files\Filesystem::resolvePath('/some/folder');
+               $this->assertEquals('folder', $internalPath);
        }
 
        public function testNormalize() {
@@ -133,20 +133,20 @@ class Filesystem extends \PHPUnit_Framework_TestCase {
        }
 
        public function testHooks() {
-               if(\OC\Files\Filesystem::getView()){
+               if (\OC\Files\Filesystem::getView()) {
                        $user = \OC_User::getUser();
-               }else{
-                       $user=uniqid();
-                       \OC\Files\Filesystem::init($user, '/'.$user.'/files');
+               } else {
+                       $user = uniqid();
+                       \OC\Files\Filesystem::init($user, '/' . $user . '/files');
                }
                \OC_Hook::clear('OC_Filesystem');
                \OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook');
 
                \OC\Files\Filesystem::mount('OC\Files\Storage\Temporary', array(), '/');
 
-               $rootView=new \OC\Files\View('');
-               $rootView->mkdir('/'.$user);
-               $rootView->mkdir('/'.$user.'/files');
+               $rootView = new \OC\Files\View('');
+               $rootView->mkdir('/' . $user);
+               $rootView->mkdir('/' . $user . '/files');
 
 //             \OC\Files\Filesystem::file_put_contents('/foo', 'foo');
                \OC\Files\Filesystem::mkdir('/bar');