diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2024-09-15 22:32:31 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2024-09-15 22:32:31 +0200 |
commit | 49dd79eabb2b8902559a7a4e8f8fcad54f46b604 (patch) | |
tree | 2af18db46ba463368dc4461d7436fb69577923de /tests/lib/Archive/TestBase.php | |
parent | 4281ce6fa1bb8235426099d720734d2394bec203 (diff) | |
download | nextcloud-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/Archive/TestBase.php')
-rw-r--r-- | tests/lib/Archive/TestBase.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/lib/Archive/TestBase.php b/tests/lib/Archive/TestBase.php index 6475b49e549..3f2d8c9561e 100644 --- a/tests/lib/Archive/TestBase.php +++ b/tests/lib/Archive/TestBase.php @@ -24,7 +24,7 @@ abstract class TestBase extends \Test\TestCase { */ abstract protected function getNew(); - public function testGetFiles() { + public function testGetFiles(): void { $this->instance = $this->getExisting(); $allFiles = $this->instance->getFiles(); $expected = ['lorem.txt','logo-wide.png','dir/', 'dir/lorem.txt']; @@ -50,7 +50,7 @@ abstract class TestBase extends \Test\TestCase { } } - public function testContent() { + public function testContent(): void { $this->instance = $this->getExisting(); $dir = \OC::$SERVERROOT.'/tests/data'; $textFile = $dir.'/lorem.txt'; @@ -61,7 +61,7 @@ abstract class TestBase extends \Test\TestCase { $this->assertEquals(file_get_contents($textFile), file_get_contents($tmpFile)); } - public function testWrite() { + public function testWrite(): void { $dir = \OC::$SERVERROOT.'/tests/data'; $textFile = $dir.'/lorem.txt'; $this->instance = $this->getNew(); @@ -76,7 +76,7 @@ abstract class TestBase extends \Test\TestCase { $this->assertEquals('foobar', $this->instance->getFile('lorem.txt')); } - public function testReadStream() { + public function testReadStream(): void { $dir = \OC::$SERVERROOT.'/tests/data'; $this->instance = $this->getExisting(); $fh = $this->instance->getStream('lorem.txt', 'r'); @@ -85,7 +85,7 @@ abstract class TestBase extends \Test\TestCase { fclose($fh); $this->assertEquals(file_get_contents($dir.'/lorem.txt'), $content); } - public function testWriteStream() { + public function testWriteStream(): void { $dir = \OC::$SERVERROOT.'/tests/data'; $this->instance = $this->getNew(); $fh = $this->instance->getStream('lorem.txt', 'w'); @@ -96,7 +96,7 @@ abstract class TestBase extends \Test\TestCase { $this->assertTrue($this->instance->fileExists('lorem.txt')); $this->assertEquals(file_get_contents($dir.'/lorem.txt'), $this->instance->getFile('lorem.txt')); } - public function testFolder() { + public function testFolder(): void { $this->instance = $this->getNew(); $this->assertFalse($this->instance->fileExists('/test')); $this->assertFalse($this->instance->fileExists('/test/')); @@ -107,7 +107,7 @@ abstract class TestBase extends \Test\TestCase { $this->assertFalse($this->instance->fileExists('/test')); $this->assertFalse($this->instance->fileExists('/test/')); } - public function testExtract() { + public function testExtract(): void { $dir = \OC::$SERVERROOT.'/tests/data'; $this->instance = $this->getExisting(); $tmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); @@ -118,7 +118,7 @@ abstract class TestBase extends \Test\TestCase { $this->assertEquals(file_get_contents($dir.'/lorem.txt'), file_get_contents($tmpDir.'lorem.txt')); \OCP\Files::rmdirr($tmpDir); } - public function testMoveRemove() { + public function testMoveRemove(): void { $dir = \OC::$SERVERROOT.'/tests/data'; $textFile = $dir.'/lorem.txt'; $this->instance = $this->getNew(); @@ -131,7 +131,7 @@ abstract class TestBase extends \Test\TestCase { $this->instance->remove('target.txt'); $this->assertFalse($this->instance->fileExists('target.txt')); } - public function testRecursive() { + public function testRecursive(): void { $dir = \OC::$SERVERROOT.'/tests/data'; $this->instance = $this->getNew(); $this->instance->addRecursive('/dir', $dir); |