aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/SimpleFS
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Files/SimpleFS')
-rw-r--r--tests/lib/Files/SimpleFS/InMemoryFileTest.php37
-rw-r--r--tests/lib/Files/SimpleFS/SimpleFileTest.php44
-rw-r--r--tests/lib/Files/SimpleFS/SimpleFolderTest.php38
3 files changed, 36 insertions, 83 deletions
diff --git a/tests/lib/Files/SimpleFS/InMemoryFileTest.php b/tests/lib/Files/SimpleFS/InMemoryFileTest.php
index 0ba1a9ddc9f..43587acdce9 100644
--- a/tests/lib/Files/SimpleFS/InMemoryFileTest.php
+++ b/tests/lib/Files/SimpleFS/InMemoryFileTest.php
@@ -3,23 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018, Michael Weimann <mail@michael-weimann.eu>
- *
- * @author Michael Weimann <mail@michael-weimann.eu>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace Test\File\SimpleFS;
@@ -59,7 +44,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testPutContent() {
+ public function testPutContent(): void {
$this->testPdf->putContent('test');
self::assertEquals('test', $this->testPdf->getContent());
}
@@ -69,7 +54,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->testPdf->delete();
// assert true, otherwise phpunit complains about not doing any assert
self::assertTrue(true);
@@ -80,7 +65,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetName() {
+ public function testGetName(): void {
self::assertEquals('test.pdf', $this->testPdf->getName());
}
@@ -89,7 +74,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetSize() {
+ public function testGetSize(): void {
self::assertEquals(7083, $this->testPdf->getSize());
}
@@ -98,7 +83,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetContent() {
+ public function testGetContent(): void {
self::assertEquals(
file_get_contents(__DIR__ . '/../../../data/test.pdf'),
$this->testPdf->getContent()
@@ -110,7 +95,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetMTime() {
+ public function testGetMTime(): void {
self::assertTrue(is_int($this->testPdf->getMTime()));
}
@@ -119,7 +104,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetMimeType() {
+ public function testGetMimeType(): void {
self::assertEquals('application/pdf', $this->testPdf->getMimeType());
}
@@ -129,7 +114,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testRead() {
+ public function testRead(): void {
self::expectException(NotPermittedException::class);
$this->testPdf->read();
}
@@ -139,7 +124,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testWrite() {
+ public function testWrite(): void {
self::expectException(NotPermittedException::class);
$this->testPdf->write();
}
diff --git a/tests/lib/Files/SimpleFS/SimpleFileTest.php b/tests/lib/Files/SimpleFS/SimpleFileTest.php
index def570edf99..6ce5ddad351 100644
--- a/tests/lib/Files/SimpleFS/SimpleFileTest.php
+++ b/tests/lib/Files/SimpleFS/SimpleFileTest.php
@@ -1,24 +1,8 @@
<?php
+
/**
- * @copyright 2016 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\File\SimpleFS;
@@ -42,7 +26,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->simpleFile = new SimpleFile($this->file);
}
- public function testGetName() {
+ public function testGetName(): void {
$this->file->expects($this->once())
->method('getName')
->willReturn('myname');
@@ -50,7 +34,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals('myname', $this->simpleFile->getName());
}
- public function testGetSize() {
+ public function testGetSize(): void {
$this->file->expects($this->once())
->method('getSize')
->willReturn(42);
@@ -58,7 +42,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals(42, $this->simpleFile->getSize());
}
- public function testGetETag() {
+ public function testGetETag(): void {
$this->file->expects($this->once())
->method('getETag')
->willReturn('etag');
@@ -66,7 +50,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals('etag', $this->simpleFile->getETag());
}
- public function testGetMTime() {
+ public function testGetMTime(): void {
$this->file->expects($this->once())
->method('getMTime')
->willReturn(101);
@@ -74,7 +58,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals(101, $this->simpleFile->getMTime());
}
- public function testGetContent() {
+ public function testGetContent(): void {
$this->file->expects($this->once())
->method('getContent')
->willReturn('foo');
@@ -82,7 +66,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals('foo', $this->simpleFile->getContent());
}
- public function testPutContent() {
+ public function testPutContent(): void {
$this->file->expects($this->once())
->method('putContent')
->with($this->equalTo('bar'));
@@ -90,14 +74,14 @@ class SimpleFileTest extends \Test\TestCase {
$this->simpleFile->putContent('bar');
}
- public function testDelete() {
+ public function testDelete(): void {
$this->file->expects($this->once())
->method('delete');
$this->simpleFile->delete();
}
- public function testGetMimeType() {
+ public function testGetMimeType(): void {
$this->file->expects($this->once())
->method('getMimeType')
->willReturn('app/awesome');
@@ -105,7 +89,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals('app/awesome', $this->simpleFile->getMimeType());
}
- public function testGetContentInvalidAppData() {
+ public function testGetContentInvalidAppData(): void {
$this->file->method('getContent')
->willReturn(false);
$this->file->method('stat')->willReturn(false);
@@ -124,7 +108,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->simpleFile->getContent();
}
- public function testRead() {
+ public function testRead(): void {
$this->file->expects($this->once())
->method('fopen')
->with('r');
@@ -132,7 +116,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->simpleFile->read();
}
- public function testWrite() {
+ public function testWrite(): void {
$this->file->expects($this->once())
->method('fopen')
->with('w');
diff --git a/tests/lib/Files/SimpleFS/SimpleFolderTest.php b/tests/lib/Files/SimpleFS/SimpleFolderTest.php
index 9710b6f438b..50038b286a9 100644
--- a/tests/lib/Files/SimpleFS/SimpleFolderTest.php
+++ b/tests/lib/Files/SimpleFS/SimpleFolderTest.php
@@ -1,24 +1,8 @@
<?php
+
/**
- * @copyright 2016 Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\File\SimpleFS;
@@ -64,24 +48,24 @@ class SimpleFolderTest extends \Test\TestCase {
$this->simpleFolder = new SimpleFolder($this->folder);
}
- public function testGetName() {
+ public function testGetName(): void {
$this->assertEquals('test', $this->simpleFolder->getName());
}
- public function testDelete() {
+ public function testDelete(): void {
$this->assertTrue($this->parentFolder->nodeExists('test'));
$this->simpleFolder->delete();
$this->assertFalse($this->parentFolder->nodeExists('test'));
}
- public function testFileExists() {
+ public function testFileExists(): void {
$this->folder->newFile('exists');
$this->assertFalse($this->simpleFolder->fileExists('not-exists'));
$this->assertTrue($this->simpleFolder->fileExists('exists'));
}
- public function testGetFile() {
+ public function testGetFile(): void {
$this->folder->newFile('exists');
$result = $this->simpleFolder->getFile('exists');
@@ -91,7 +75,7 @@ class SimpleFolderTest extends \Test\TestCase {
$this->simpleFolder->getFile('not-exists');
}
- public function testNewFile() {
+ public function testNewFile(): void {
$result = $this->simpleFolder->newFile('file');
$this->assertInstanceOf(ISimpleFile::class, $result);
$this->assertFalse($this->folder->nodeExists('file'));
@@ -101,7 +85,7 @@ class SimpleFolderTest extends \Test\TestCase {
$this->assertEquals('bar', $result->getContent());
}
- public function testGetDirectoryListing() {
+ public function testGetDirectoryListing(): void {
$this->folder->newFile('file1');
$this->folder->newFile('file2');
@@ -111,7 +95,7 @@ class SimpleFolderTest extends \Test\TestCase {
$this->assertInstanceOf(ISimpleFile::class, $result[1]);
}
- public function testGetFolder() {
+ public function testGetFolder(): void {
$this->folder->newFolder('exists');
$result = $this->simpleFolder->getFolder('exists');
@@ -121,7 +105,7 @@ class SimpleFolderTest extends \Test\TestCase {
$this->simpleFolder->getFolder('not-exists');
}
- public function testNewFolder() {
+ public function testNewFolder(): void {
$result = $this->simpleFolder->newFolder('folder');
$this->assertInstanceOf(ISimpleFolder::class, $result);
$result->newFile('file');