aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/Cache/ScannerTest.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2024-09-15 22:32:31 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2024-09-15 22:32:31 +0200
commit49dd79eabb2b8902559a7a4e8f8fcad54f46b604 (patch)
tree2af18db46ba463368dc4461d7436fb69577923de /tests/lib/Files/Cache/ScannerTest.php
parent4281ce6fa1bb8235426099d720734d2394bec203 (diff)
downloadnextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.tar.gz
nextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.zip
refactor: Add void return type to PHPUnit test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Files/Cache/ScannerTest.php')
-rw-r--r--tests/lib/Files/Cache/ScannerTest.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/lib/Files/Cache/ScannerTest.php b/tests/lib/Files/Cache/ScannerTest.php
index bc911baba0c..d78b7100d43 100644
--- a/tests/lib/Files/Cache/ScannerTest.php
+++ b/tests/lib/Files/Cache/ScannerTest.php
@@ -42,7 +42,7 @@ class ScannerTest extends TestCase {
parent::tearDown();
}
- public function testFile() {
+ public function testFile(): void {
$data = "dummy file data\n";
$this->storage->file_put_contents('foo.txt', $data);
$this->scanner->scanFile('foo.txt');
@@ -63,7 +63,7 @@ class ScannerTest extends TestCase {
$this->assertEquals($cachedData['mimetype'], 'image/png');
}
- public function testFile4Byte() {
+ public function testFile4Byte(): void {
$data = "dummy file data\n";
$this->storage->file_put_contents('foo🙈.txt', $data);
@@ -81,7 +81,7 @@ class ScannerTest extends TestCase {
}
}
- public function testFileInvalidChars() {
+ public function testFileInvalidChars(): void {
$data = "dummy file data\n";
$this->storage->file_put_contents("foo\nbar.txt", $data);
@@ -98,7 +98,7 @@ class ScannerTest extends TestCase {
$this->storage->file_put_contents('folder/bar.txt', $textData);
}
- public function testFolder() {
+ public function testFolder(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -120,7 +120,7 @@ class ScannerTest extends TestCase {
$this->assertEquals($cachedDataFolder2['size'], $cachedDataText2['size']);
}
- public function testShallow() {
+ public function testShallow(): void {
$this->fillTestFolders();
$this->scanner->scan('', IScanner::SCAN_SHALLOW);
@@ -148,7 +148,7 @@ class ScannerTest extends TestCase {
$this->assertNotEquals($cachedDataFolder['size'], -1);
}
- public function testBackgroundScan() {
+ public function testBackgroundScan(): void {
$this->fillTestFolders();
$this->storage->mkdir('folder2');
$this->storage->file_put_contents('folder2/bar.txt', 'foobar');
@@ -170,7 +170,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->getIncomplete());
}
- public function testBackgroundScanOnlyRecurseIncomplete() {
+ public function testBackgroundScanOnlyRecurseIncomplete(): void {
$this->fillTestFolders();
$this->storage->mkdir('folder2');
$this->storage->file_put_contents('folder2/bar.txt', 'foobar');
@@ -196,7 +196,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->getIncomplete());
}
- public function testBackgroundScanNestedIncompleteFolders() {
+ public function testBackgroundScanNestedIncompleteFolders(): void {
$this->storage->mkdir('folder');
$this->scanner->backgroundScan();
@@ -234,7 +234,7 @@ class ScannerTest extends TestCase {
$this->assertEquals(6, $this->cache->get('folder/subfolder2')['size']);
}
- public function testReuseExisting() {
+ public function testReuseExisting(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -273,7 +273,7 @@ class ScannerTest extends TestCase {
$this->assertEquals($oldData['size'], $newData['size']);
}
- public function testRemovedFile() {
+ public function testRemovedFile(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -283,7 +283,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->inCache('foo.txt'));
}
- public function testRemovedFolder() {
+ public function testRemovedFolder(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -294,7 +294,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->inCache('folder/bar.txt'));
}
- public function testScanRemovedFile() {
+ public function testScanRemovedFile(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -304,7 +304,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->inCache('folder/bar.txt'));
}
- public function testETagRecreation() {
+ public function testETagRecreation(): void {
$this->fillTestFolders();
$this->scanner->scan('folder/bar.txt');
@@ -330,7 +330,7 @@ class ScannerTest extends TestCase {
$this->assertNotEmpty($newData0['etag']);
}
- public function testRepairParent() {
+ public function testRepairParent(): void {
$this->fillTestFolders();
$this->scanner->scan('');
$this->assertTrue($this->cache->inCache('folder/bar.txt'));
@@ -356,7 +356,7 @@ class ScannerTest extends TestCase {
$this->assertEquals($newFolderId, $cachedData['parent']);
}
- public function testRepairParentShallow() {
+ public function testRepairParentShallow(): void {
$this->fillTestFolders();
$this->scanner->scan('');
$this->assertTrue($this->cache->inCache('folder/bar.txt'));
@@ -388,7 +388,7 @@ class ScannerTest extends TestCase {
* @param string $path
* @param bool $expected
*/
- public function testIsPartialFile($path, $expected) {
+ public function testIsPartialFile($path, $expected): void {
$this->assertSame($expected,
$this->scanner->isPartialFile($path)
);
@@ -404,7 +404,7 @@ class ScannerTest extends TestCase {
];
}
- public function testNoETagUnscannedFolder() {
+ public function testNoETagUnscannedFolder(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -423,7 +423,7 @@ class ScannerTest extends TestCase {
$this->assertNotEquals($newFolderEntry->getEtag(), $oldFolderEntry->getEtag());
}
- public function testNoETagUnscannedSubFolder() {
+ public function testNoETagUnscannedSubFolder(): void {
$this->fillTestFolders();
$this->storage->mkdir('folder/sub');