summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Upload
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2023-01-20 08:38:43 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2023-01-20 08:38:43 +0100
commit898d2923cce4e61e21a26fed06ad402452c0b3b1 (patch)
treee9f3b91311c880074ff317a45700e080340fece0 /apps/dav/tests/unit/Upload
parent5e3a3c0c8faa45489aa6ac610728b4177501c198 (diff)
downloadnextcloud-server-898d2923cce4e61e21a26fed06ad402452c0b3b1.tar.gz
nextcloud-server-898d2923cce4e61e21a26fed06ad402452c0b3b1.zip
chore(dav): Add void return type to test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/tests/unit/Upload')
-rw-r--r--apps/dav/tests/unit/Upload/AssemblyStreamTest.php6
-rw-r--r--apps/dav/tests/unit/Upload/ChunkingPluginTest.php10
-rw-r--r--apps/dav/tests/unit/Upload/FutureFileTest.php18
3 files changed, 17 insertions, 17 deletions
diff --git a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
index c7d2fea2871..7dd051f859f 100644
--- a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
+++ b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
@@ -35,7 +35,7 @@ class AssemblyStreamTest extends \Test\TestCase {
/**
* @dataProvider providesNodes()
*/
- public function testGetContents($expected, $nodes) {
+ public function testGetContents($expected, $nodes): void {
$stream = \OCA\DAV\Upload\AssemblyStream::wrap($nodes);
$content = stream_get_contents($stream);
@@ -45,7 +45,7 @@ class AssemblyStreamTest extends \Test\TestCase {
/**
* @dataProvider providesNodes()
*/
- public function testGetContentsFread($expected, $nodes) {
+ public function testGetContentsFread($expected, $nodes): void {
$stream = \OCA\DAV\Upload\AssemblyStream::wrap($nodes);
$content = '';
@@ -59,7 +59,7 @@ class AssemblyStreamTest extends \Test\TestCase {
/**
* @dataProvider providesNodes()
*/
- public function testSeek($expected, $nodes) {
+ public function testSeek($expected, $nodes): void {
$stream = \OCA\DAV\Upload\AssemblyStream::wrap($nodes);
$offset = floor(strlen($expected) * 0.6);
diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
index 4c22b803fc3..358908796a4 100644
--- a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
+++ b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
@@ -75,7 +75,7 @@ class ChunkingPluginTest extends TestCase {
$this->plugin->initialize($this->server);
}
- public function testBeforeMoveFutureFileSkip() {
+ public function testBeforeMoveFutureFileSkip(): void {
$node = $this->createMock(Directory::class);
$this->tree->expects($this->any())
@@ -88,7 +88,7 @@ class ChunkingPluginTest extends TestCase {
$this->assertNull($this->plugin->beforeMove('source', 'target'));
}
- public function testBeforeMoveDestinationIsDirectory() {
+ public function testBeforeMoveDestinationIsDirectory(): void {
$this->expectException(\Sabre\DAV\Exception\BadRequest::class);
$this->expectExceptionMessage('The given destination target is a directory.');
@@ -111,7 +111,7 @@ class ChunkingPluginTest extends TestCase {
$this->assertNull($this->plugin->beforeMove('source', 'target'));
}
- public function testBeforeMoveFutureFileSkipNonExisting() {
+ public function testBeforeMoveFutureFileSkipNonExisting(): void {
$sourceNode = $this->createMock(FutureFile::class);
$sourceNode->expects($this->once())
->method('getSize')
@@ -145,7 +145,7 @@ class ChunkingPluginTest extends TestCase {
$this->assertFalse($this->plugin->beforeMove('source', 'target'));
}
- public function testBeforeMoveFutureFileMoveIt() {
+ public function testBeforeMoveFutureFileMoveIt(): void {
$sourceNode = $this->createMock(FutureFile::class);
$sourceNode->expects($this->once())
->method('getSize')
@@ -185,7 +185,7 @@ class ChunkingPluginTest extends TestCase {
}
- public function testBeforeMoveSizeIsWrong() {
+ public function testBeforeMoveSizeIsWrong(): void {
$this->expectException(\Sabre\DAV\Exception\BadRequest::class);
$this->expectExceptionMessage('Chunks on server do not sum up to 4 but to 3 bytes');
diff --git a/apps/dav/tests/unit/Upload/FutureFileTest.php b/apps/dav/tests/unit/Upload/FutureFileTest.php
index 0c276167e1c..c12ec2f63cb 100644
--- a/apps/dav/tests/unit/Upload/FutureFileTest.php
+++ b/apps/dav/tests/unit/Upload/FutureFileTest.php
@@ -28,38 +28,38 @@ namespace OCA\DAV\Tests\unit\Upload;
use OCA\DAV\Connector\Sabre\Directory;
class FutureFileTest extends \Test\TestCase {
- public function testGetContentType() {
+ public function testGetContentType(): void {
$f = $this->mockFutureFile();
$this->assertEquals('application/octet-stream', $f->getContentType());
}
- public function testGetETag() {
+ public function testGetETag(): void {
$f = $this->mockFutureFile();
$this->assertEquals('1234567890', $f->getETag());
}
- public function testGetName() {
+ public function testGetName(): void {
$f = $this->mockFutureFile();
$this->assertEquals('foo.txt', $f->getName());
}
- public function testGetLastModified() {
+ public function testGetLastModified(): void {
$f = $this->mockFutureFile();
$this->assertEquals(12121212, $f->getLastModified());
}
- public function testGetSize() {
+ public function testGetSize(): void {
$f = $this->mockFutureFile();
$this->assertEquals(0, $f->getSize());
}
- public function testGet() {
+ public function testGet(): void {
$f = $this->mockFutureFile();
$stream = $f->get();
$this->assertTrue(is_resource($stream));
}
- public function testDelete() {
+ public function testDelete(): void {
$d = $this->getMockBuilder(Directory::class)
->disableOriginalConstructor()
->setMethods(['delete'])
@@ -73,7 +73,7 @@ class FutureFileTest extends \Test\TestCase {
}
- public function testPut() {
+ public function testPut(): void {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
$f = $this->mockFutureFile();
@@ -81,7 +81,7 @@ class FutureFileTest extends \Test\TestCase {
}
- public function testSetName() {
+ public function testSetName(): void {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
$f = $this->mockFutureFile();