]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove duplicate test class
authorRobin Appelman <icewind@owncloud.com>
Tue, 14 Jan 2014 14:11:41 +0000 (15:11 +0100)
committerRobin Appelman <icewind@owncloud.com>
Tue, 14 Jan 2014 14:11:41 +0000 (15:11 +0100)
tests/lib/files/etagtest.php
tests/lib/files/view.php

index 14003896d66e0f79a536e18c75f2204bb7960631..6c41413c4df27a6f9b60bb42f8750c1b157a39b6 100644 (file)
@@ -11,12 +11,6 @@ namespace Test\Files;
 use OC\Files\Filesystem;
 use OCP\Share;
 
-class TemporaryNoTouch extends \OC\Files\Storage\Temporary {
-       public function touch($path, $mtime = null) {
-               return false;
-       }
-}
-
 class EtagTest extends \PHPUnit_Framework_TestCase {
        private $datadir;
 
@@ -74,23 +68,6 @@ class EtagTest extends \PHPUnit_Framework_TestCase {
                $this->assertEquals($originalEtags, $this->getEtags($files));
        }
 
-       public function testTouchNotSupported() {
-               $storage = new TemporaryNoTouch(array());
-               $scanner = $storage->getScanner();
-               Filesystem::mount($storage, array(), '/test/');
-               $past = time() - 100;
-               $storage->file_put_contents('test', 'foobar');
-               $scanner->scan('');
-               $view = new \OC\Files\View('');
-               $info = $view->getFileInfo('/test/test');
-
-               $view->touch('/test/test', $past);
-               $scanner->scanFile('test', \OC\Files\Cache\Scanner::REUSE_ETAG);
-
-               $info2 = $view->getFileInfo('/test/test');
-               $this->assertEquals($info['etag'], $info2['etag']);
-       }
-
        private function getEtags($files) {
                $etags = array();
                foreach ($files as $file) {
index 76a7fd5f1ca80ef5479cc9b686e7034bb99e1593..72a2f854cb2d22e639f3fc8d0fc12f49aba5f07a 100644 (file)
@@ -545,4 +545,21 @@ class View extends \PHPUnit_Framework_TestCase {
                        $this->assertContains($item['name'], $names);
                }
        }
+
+       public function testTouchNotSupported() {
+               $storage = new TemporaryNoTouch(array());
+               $scanner = $storage->getScanner();
+               \OC\Files\Filesystem::mount($storage, array(), '/test/');
+               $past = time() - 100;
+               $storage->file_put_contents('test', 'foobar');
+               $scanner->scan('');
+               $view = new \OC\Files\View('');
+               $info = $view->getFileInfo('/test/test');
+
+               $view->touch('/test/test', $past);
+               $scanner->scanFile('test', \OC\Files\Cache\Scanner::REUSE_ETAG);
+
+               $info2 = $view->getFileInfo('/test/test');
+               $this->assertEquals($info['etag'], $info2['etag']);
+       }
 }