diff options
Diffstat (limited to 'tests/lib/Lockdown/Filesystem/NullCacheTest.php')
-rw-r--r-- | tests/lib/Lockdown/Filesystem/NullCacheTest.php | 64 |
1 files changed, 24 insertions, 40 deletions
diff --git a/tests/lib/Lockdown/Filesystem/NullCacheTest.php b/tests/lib/Lockdown/Filesystem/NullCacheTest.php index 0f979350bac..505951ea2ef 100644 --- a/tests/lib/Lockdown/Filesystem/NullCacheTest.php +++ b/tests/lib/Lockdown/Filesystem/NullCacheTest.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\Lockdown\Filesystem; @@ -39,15 +23,15 @@ class NulLCacheTest extends \Test\TestCase { $this->cache = new NullCache(); } - public function testGetNumericStorageId() { + public function testGetNumericStorageId(): void { $this->assertSame(-1, $this->cache->getNumericStorageId()); } - public function testGetEmpty() { - $this->assertNull($this->cache->get('foo')); + public function testGetEmpty(): void { + $this->assertFalse($this->cache->get('foo')); } - public function testGet() { + public function testGet(): void { $data = $this->cache->get(''); $this->assertEquals(-1, $data['fileid']); @@ -61,63 +45,63 @@ class NulLCacheTest extends \Test\TestCase { $this->assertEquals(Constants::PERMISSION_READ, $data['permissions']); } - public function testGetFolderContents() { + public function testGetFolderContents(): void { $this->assertSame([], $this->cache->getFolderContents('foo')); } - public function testGetFolderContentsById() { + public function testGetFolderContentsById(): void { $this->assertSame([], $this->cache->getFolderContentsById(42)); } - public function testPut() { + public function testPut(): void { $this->expectException(ForbiddenException::class); $this->expectExceptionMessage('This request is not allowed to access the filesystem'); $this->cache->put('foo', ['size' => 100]); } - public function testInsert() { + public function testInsert(): void { $this->expectException(ForbiddenException::class); $this->expectExceptionMessage('This request is not allowed to access the filesystem'); $this->cache->insert('foo', ['size' => 100]); } - public function testUpdate() { + public function testUpdate(): void { $this->expectException(ForbiddenException::class); $this->expectExceptionMessage('This request is not allowed to access the filesystem'); $this->cache->update('foo', ['size' => 100]); } - public function testGetId() { + public function testGetId(): void { $this->assertSame(-1, $this->cache->getId('foo')); } - public function testGetParentId() { + public function testGetParentId(): void { $this->assertSame(-1, $this->cache->getParentId('foo')); } - public function testInCache() { + public function testInCache(): void { $this->assertTrue($this->cache->inCache('')); $this->assertFalse($this->cache->inCache('foo')); } - public function testRemove() { + public function testRemove(): void { $this->expectException(ForbiddenException::class); $this->expectExceptionMessage('This request is not allowed to access the filesystem'); $this->cache->remove('foo'); } - public function testMove() { + public function testMove(): void { $this->expectException(ForbiddenException::class); $this->expectExceptionMessage('This request is not allowed to access the filesystem'); $this->cache->move('foo', 'bar'); } - public function testMoveFromCache() { + public function testMoveFromCache(): void { $sourceCache = $this->createMock(ICache::class); $this->expectException(ForbiddenException::class); @@ -126,27 +110,27 @@ class NulLCacheTest extends \Test\TestCase { $this->cache->moveFromCache($sourceCache, 'foo', 'bar'); } - public function testGetStatus() { + public function testGetStatus(): void { $this->assertSame(ICache::COMPLETE, $this->cache->getStatus('foo')); } - public function testSearch() { + public function testSearch(): void { $this->assertSame([], $this->cache->search('foo')); } - public function testSearchByMime() { + public function testSearchByMime(): void { $this->assertSame([], $this->cache->searchByMime('foo')); } - public function testGetIncomplete() { + public function testGetIncomplete(): void { $this->assertSame([], $this->cache->getIncomplete()); } - public function testGetPathById() { + public function testGetPathById(): void { $this->assertSame('', $this->cache->getPathById(42)); } - public function testNormalize() { + public function testNormalize(): void { $this->assertSame('foo/ bar /', $this->cache->normalize('foo/ bar /')); } } |