aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/Cache/Wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Files/Cache/Wrapper')
-rw-r--r--tests/lib/Files/Cache/Wrapper/CacheJailTest.php12
-rw-r--r--tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php13
2 files changed, 15 insertions, 10 deletions
diff --git a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
index 57024e2eb79..8ac3492fbd2 100644
--- a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
+++ b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -7,6 +8,7 @@
namespace Test\Files\Cache\Wrapper;
+use OC\Files\Cache\Cache;
use OC\Files\Cache\Wrapper\CacheJail;
use OC\Files\Cache\Wrapper\CacheWrapper;
use OC\Files\Search\SearchComparison;
@@ -27,7 +29,7 @@ use Test\Files\Cache\CacheTest;
*/
class CacheJailTest extends CacheTest {
/**
- * @var \OC\Files\Cache\Cache $sourceCache
+ * @var Cache $sourceCache
*/
protected $sourceCache;
@@ -35,7 +37,7 @@ class CacheJailTest extends CacheTest {
parent::setUp();
$this->storage->mkdir('jail');
$this->sourceCache = $this->cache;
- $this->cache = new \OC\Files\Cache\Wrapper\CacheJail($this->sourceCache, 'jail');
+ $this->cache = new CacheJail($this->sourceCache, 'jail');
$this->cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]);
}
@@ -130,7 +132,7 @@ class CacheJailTest extends CacheTest {
$this->assertEquals('bar', $path);
// path from jailed '' of foo/bar is foo/bar
- $this->cache = new \OC\Files\Cache\Wrapper\CacheJail($this->sourceCache, '');
+ $this->cache = new CacheJail($this->sourceCache, '');
$path = $this->cache->getPathById($id);
$this->assertEquals('jail/bar', $path);
}
@@ -200,7 +202,7 @@ class CacheJailTest extends CacheTest {
$this->sourceCache->put($file2, $data1);
$this->sourceCache->put($file3, $data1);
- $nested = new \OC\Files\Cache\Wrapper\CacheJail($this->cache, 'bar');
+ $nested = new CacheJail($this->cache, 'bar');
$result = $nested->search('%asd%');
$this->assertCount(1, $result);
@@ -218,7 +220,7 @@ class CacheJailTest extends CacheTest {
$this->sourceCache->put($file2, $data1);
$this->sourceCache->put($file3, $data1);
- $nested = new \OC\Files\Cache\Wrapper\CacheJail($this->sourceCache, '');
+ $nested = new CacheJail($this->sourceCache, '');
$result = $nested->search('%asd%');
$this->assertCount(1, $result);
diff --git a/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php b/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php
index 9aa1ee5b723..4fbeafc9270 100644
--- a/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php
+++ b/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -7,6 +8,8 @@
namespace Test\Files\Cache\Wrapper;
+use OC\Files\Cache\Cache;
+use OC\Files\Cache\Wrapper\CachePermissionsMask;
use OCP\Constants;
use Test\Files\Cache\CacheTest;
@@ -19,7 +22,7 @@ use Test\Files\Cache\CacheTest;
*/
class CachePermissionsMaskTest extends CacheTest {
/**
- * @var \OC\Files\Cache\Cache $sourceCache
+ * @var Cache $sourceCache
*/
protected $sourceCache;
@@ -31,7 +34,7 @@ class CachePermissionsMaskTest extends CacheTest {
}
protected function getMaskedCached($mask) {
- return new \OC\Files\Cache\Wrapper\CachePermissionsMask($this->sourceCache, $mask);
+ return new CachePermissionsMask($this->sourceCache, $mask);
}
public static function maskProvider(): array {
@@ -44,9 +47,9 @@ class CachePermissionsMaskTest extends CacheTest {
}
/**
- * @dataProvider maskProvider
* @param int $mask
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('maskProvider')]
public function testGetMasked($mask): void {
$cache = $this->getMaskedCached($mask);
$data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL];
@@ -61,9 +64,9 @@ class CachePermissionsMaskTest extends CacheTest {
}
/**
- * @dataProvider maskProvider
* @param int $mask
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('maskProvider')]
public function testGetFolderContentMasked($mask): void {
$this->storage->mkdir('foo');
$this->storage->file_put_contents('foo/bar', 'asd');
@@ -80,9 +83,9 @@ class CachePermissionsMaskTest extends CacheTest {
}
/**
- * @dataProvider maskProvider
* @param int $mask
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('maskProvider')]
public function testSearchMasked($mask): void {
$this->storage->mkdir('foo');
$this->storage->file_put_contents('foo/bar', 'asd');