diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-07-26 03:18:39 -0700 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-07-26 03:18:39 -0700 |
commit | e4132a61c9895b14bebd5008763c2a69de29d408 (patch) | |
tree | d37ab241cb46b953cbe0d165cf223b7c057d4130 | |
parent | 1b50154c951aac132b90c7bdd7f260acf47e8c78 (diff) | |
parent | c517c845f6c4d1199e1485adb8947e01602659e5 (diff) | |
download | nextcloud-server-e4132a61c9895b14bebd5008763c2a69de29d408.tar.gz nextcloud-server-e4132a61c9895b14bebd5008763c2a69de29d408.zip |
Merge pull request #4093 from owncloud/storage-test-cleanup
Remove outdated unit tests for storage backend
-rw-r--r-- | tests/lib/files/storage/storage.php | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index fbf502fbc1c..3f339a10016 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -176,68 +176,21 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertEquals(filesize($textFile), $this->instance->filesize('/lorem.txt')); $stat = $this->instance->stat('/lorem.txt'); - //only size and mtime are requered in the result + //only size and mtime are required in the result $this->assertEquals($stat['size'], $this->instance->filesize('/lorem.txt')); $this->assertEquals($stat['mtime'], $mTime); - $mtimeStart = time(); - $supportsTouch = $this->instance->touch('/lorem.txt'); - $mtimeEnd = time(); - if ($supportsTouch !== false) { + if ($this->instance->touch('/lorem.txt', 100) !== false) { $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue(($mtimeStart - 5) <= $mTime); - $this->assertTrue($mTime <= ($mtimeEnd + 5)); - - $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $mtimeStart - 5)); - - if ($this->instance->touch('/lorem.txt', 100) !== false) { - $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertEquals($mTime, 100); - } + $this->assertEquals($mTime, 100); } $mtimeStart = time(); - $fh = $this->instance->fopen('/lorem.txt', 'a'); - fwrite($fh, ' '); - fclose($fh); - clearstatcache(); - $mtimeEnd = time(); - $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue(($mtimeStart - 5) <= $mTime); - $this->assertTrue($mTime <= ($mtimeEnd + 5)); $this->instance->unlink('/lorem.txt'); $this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 5)); } - public function testSearch() { - $textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt'; - $this->instance->file_put_contents('/lorem.txt', file_get_contents($textFile, 'r')); - $pngFile = \OC::$SERVERROOT . '/tests/data/logo-wide.png'; - $this->instance->file_put_contents('/logo-wide.png', file_get_contents($pngFile, 'r')); - $svgFile = \OC::$SERVERROOT . '/tests/data/logo-wide.svg'; - $this->instance->file_put_contents('/logo-wide.svg', file_get_contents($svgFile, 'r')); - $result = $this->instance->search('logo'); - $this->assertEquals(2, count($result)); - $this->assertContains('/logo-wide.svg', $result); - $this->assertContains('/logo-wide.png', $result); - } - - public function testSearchInSubFolder() { - $this->instance->mkdir('sub'); - $textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt'; - $this->instance->file_put_contents('/sub/lorem.txt', file_get_contents($textFile, 'r')); - $pngFile = \OC::$SERVERROOT . '/tests/data/logo-wide.png'; - $this->instance->file_put_contents('/sub/logo-wide.png', file_get_contents($pngFile, 'r')); - $svgFile = \OC::$SERVERROOT . '/tests/data/logo-wide.svg'; - $this->instance->file_put_contents('/sub/logo-wide.svg', file_get_contents($svgFile, 'r')); - - $result = $this->instance->search('logo'); - $this->assertEquals(2, count($result)); - $this->assertContains('/sub/logo-wide.svg', $result); - $this->assertContains('/sub/logo-wide.png', $result); - } - public function testFOpen() { $textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt'; |