diff options
Diffstat (limited to 'tests/lib/Files/Cache/CacheTest.php')
-rw-r--r-- | tests/lib/Files/Cache/CacheTest.php | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/tests/lib/Files/Cache/CacheTest.php b/tests/lib/Files/Cache/CacheTest.php index b90b67a6589..9e3460ab6f2 100644 --- a/tests/lib/Files/Cache/CacheTest.php +++ b/tests/lib/Files/Cache/CacheTest.php @@ -47,11 +47,11 @@ class CacheTest extends \Test\TestCase { */ protected $cache2; - public function testGetNumericId() { + public function testGetNumericId(): void { $this->assertNotNull($this->cache->getNumericStorageId()); } - public function testSimple() { + public function testSimple(): void { $file1 = 'foo'; $file2 = 'foo/bar'; $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder']; @@ -97,7 +97,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals($cacheData1, $this->cache->get($id1)); } - public function testCacheEntryGetters() { + public function testCacheEntryGetters(): void { $file1 = 'foo'; $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/file']; @@ -122,7 +122,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals($entry->getUnencryptedSize(), 100); } - public function testPartial() { + public function testPartial(): void { $file1 = 'foo'; $this->cache->put($file1, ['size' => 10]); @@ -138,7 +138,7 @@ class CacheTest extends \Test\TestCase { /** * @dataProvider folderDataProvider */ - public function testFolder($folder) { + public function testFolder($folder): void { if (strpos($folder, 'F09F9890')) { // 4 byte UTF doesn't work on mysql $params = \OC::$server->get(\OC\DB\Connection::class)->getParams(); @@ -187,7 +187,7 @@ class CacheTest extends \Test\TestCase { $this->assertFalse($this->cache->inCache($folder . '/bar')); } - public function testRemoveRecursive() { + public function testRemoveRecursive(): void { $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; $fileData = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'text/plain']; $folders = ['folder', 'folder/subfolder', 'folder/sub2', 'folder/sub2/sub3']; @@ -220,7 +220,7 @@ class CacheTest extends \Test\TestCase { ]; } - public function testEncryptedFolder() { + public function testEncryptedFolder(): void { $file1 = 'folder'; $file2 = 'folder/bar'; $file3 = 'folder/foo'; @@ -263,7 +263,7 @@ class CacheTest extends \Test\TestCase { $this->assertFalse($this->cache->inCache('folder/bar')); } - public function testRootFolderSizeForNonHomeStorage() { + public function testRootFolderSizeForNonHomeStorage(): void { $dir1 = 'knownsize'; $dir2 = 'unknownsize'; $fileData = []; @@ -290,7 +290,7 @@ class CacheTest extends \Test\TestCase { $this->assertFalse($this->cache->inCache($dir2)); } - public function testStatus() { + public function testStatus(): void { $this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->getStatus('foo')); $this->cache->put('foo', ['size' => -1]); $this->assertEquals(\OC\Files\Cache\Cache::PARTIAL, $this->cache->getStatus('foo')); @@ -312,7 +312,7 @@ class CacheTest extends \Test\TestCase { * @dataProvider putWithAllKindOfQuotesData * @param $fileName */ - public function testPutWithAllKindOfQuotes($fileName) { + public function testPutWithAllKindOfQuotes($fileName): void { $this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->get($fileName)); $this->cache->put($fileName, ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file', 'etag' => $fileName]); @@ -321,7 +321,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals($fileName, $cacheEntry['path']); } - public function testSearch() { + public function testSearch(): void { $file1 = 'folder'; $file2 = 'folder/foobar'; $file3 = 'folder/foo'; @@ -350,7 +350,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals(2, count($this->cache->searchByMime('foo/file'))); } - public function testSearchQueryByTag() { + public function testSearchQueryByTag(): void { $userId = static::getUniqueID('user'); \OC::$server->getUserManager()->createUser($userId, $userId); static::loginAsUser($userId); @@ -408,7 +408,7 @@ class CacheTest extends \Test\TestCase { } } - public function testSearchByQuery() { + public function testSearchByQuery(): void { $file1 = 'folder'; $file2 = 'folder/foobar'; $file3 = 'folder/foo'; @@ -448,7 +448,7 @@ class CacheTest extends \Test\TestCase { /** * @dataProvider movePathProvider */ - public function testMove($sourceFolder, $targetFolder, $children) { + public function testMove($sourceFolder, $targetFolder, $children): void { $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar']; $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; @@ -483,7 +483,7 @@ class CacheTest extends \Test\TestCase { } } - public function testMoveFromCache() { + public function testMoveFromCache(): void { $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar']; $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; @@ -500,7 +500,7 @@ class CacheTest extends \Test\TestCase { $this->assertTrue($this->cache->inCache('targetfolder/sub')); } - public function testGetIncomplete() { + public function testGetIncomplete(): void { $file1 = 'folder1'; $file2 = 'folder2'; $file3 = 'folder3'; @@ -517,13 +517,13 @@ class CacheTest extends \Test\TestCase { $this->assertEquals($file3, $this->cache->getIncomplete()); } - public function testNonExisting() { + public function testNonExisting(): void { $this->assertFalse($this->cache->get('foo.txt')); $this->assertFalse($this->cache->get(-1)); $this->assertEquals([], $this->cache->getFolderContents('foo')); } - public function testGetById() { + public function testGetById(): void { $storageId = $this->storage->getId(); $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file']; $id = $this->cache->put('foo', $data); @@ -534,7 +534,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals([$storageId, 'foo'], \OC\Files\Cache\Cache::getById($id)); } - public function testStorageMTime() { + public function testStorageMTime(): void { $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file']; $this->cache->put('foo', $data); $cachedData = $this->cache->get('foo'); @@ -551,7 +551,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals(25, $cachedData['mtime']); } - public function testLongId() { + public function testLongId(): void { $storage = new LongId([]); $cache = $storage->getCache(); $storageId = $storage->getId(); @@ -563,7 +563,7 @@ class CacheTest extends \Test\TestCase { /** * this test show the bug resulting if we have no normalizer installed */ - public function testWithoutNormalizer() { + public function testWithoutNormalizer(): void { // folder name "Schön" with U+00F6 (normalized) $folderWith00F6 = "\x53\x63\x68\xc3\xb6\x6e"; @@ -609,7 +609,7 @@ class CacheTest extends \Test\TestCase { /** * this test shows that there is no bug if we use the normalizer */ - public function testWithNormalizer() { + public function testWithNormalizer(): void { if (!class_exists('Patchwork\PHP\Shim\Normalizer')) { $this->markTestSkipped('The 3rdparty Normalizer extension is not available.'); return; @@ -659,7 +659,7 @@ class CacheTest extends \Test\TestCase { * * @dataProvider bogusPathNamesProvider */ - public function testBogusPaths($bogusPath, $fixedBogusPath) { + public function testBogusPaths($bogusPath, $fixedBogusPath): void { $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; // put root folder @@ -681,7 +681,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals($newData, $newDataFromBogus); } - public function testNoReuseOfFileId() { + public function testNoReuseOfFileId(): void { $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain']; $this->cache->put('somefile.txt', $data1); $info = $this->cache->get('somefile.txt'); @@ -706,7 +706,7 @@ class CacheTest extends \Test\TestCase { * @param string $name * @dataProvider escapingProvider */ - public function testEscaping($name) { + public function testEscaping($name): void { $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain']; $this->cache->put($name, $data); $this->assertTrue($this->cache->inCache($name)); @@ -742,7 +742,7 @@ class CacheTest extends \Test\TestCase { } } - public function testExtended() { + public function testExtended(): void { $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; $this->cache->put('', $folderData); |