diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-01-14 15:11:41 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-01-14 15:11:41 +0100 |
commit | 4113042c8f8a24a604e64b0d774a9b8dbdb48567 (patch) | |
tree | c18ca8892d94ac309fe575a8410c5d3f3c91e3f5 /tests | |
parent | 203d5d01cabae52373f556d50f2bb541560eb4b0 (diff) | |
download | nextcloud-server-4113042c8f8a24a604e64b0d774a9b8dbdb48567.tar.gz nextcloud-server-4113042c8f8a24a604e64b0d774a9b8dbdb48567.zip |
remove duplicate test class
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/etagtest.php | 23 | ||||
-rw-r--r-- | tests/lib/files/view.php | 17 |
2 files changed, 17 insertions, 23 deletions
diff --git a/tests/lib/files/etagtest.php b/tests/lib/files/etagtest.php index 14003896d66..6c41413c4df 100644 --- a/tests/lib/files/etagtest.php +++ b/tests/lib/files/etagtest.php @@ -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) { diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 76a7fd5f1ca..72a2f854cb2 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -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']); + } } |