diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 13:47:39 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:28:34 +0100 |
commit | e3e782b63df4f1d65c86cb3b204b4bdecf93a6cd (patch) | |
tree | 6a910abb5f55575c9381c6dc56ba55179b6b4021 /apps | |
parent | 734d496d6379b67d9fb238e0a6f1a3bff2c2e0e7 (diff) | |
download | nextcloud-server-e3e782b63df4f1d65c86cb3b204b4bdecf93a6cd.tar.gz nextcloud-server-e3e782b63df4f1d65c86cb3b204b4bdecf93a6cd.zip |
Fix external storagestests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/tests/Service/StoragesServiceTest.php | 18 | ||||
-rw-r--r-- | apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php | 12 |
2 files changed, 18 insertions, 12 deletions
diff --git a/apps/files_external/tests/Service/StoragesServiceTest.php b/apps/files_external/tests/Service/StoragesServiceTest.php index 140bbdc772b..33186724338 100644 --- a/apps/files_external/tests/Service/StoragesServiceTest.php +++ b/apps/files_external/tests/Service/StoragesServiceTest.php @@ -252,10 +252,7 @@ abstract class StoragesServiceTest extends \Test\TestCase { } - - public function testNonExistingStorage() { - $this->expectException(\OCA\Files_External\NotFoundException::class); - + protected function ActualNonExistingStorageTest() { $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); $storage = new StorageConfig(255); @@ -265,6 +262,12 @@ abstract class StoragesServiceTest extends \Test\TestCase { $this->service->updateStorage($storage); } + public function testNonExistingStorage() { + $this->expectException(\OCA\Files_External\NotFoundException::class); + + $this->ActualNonExistingStorageTest(); + } + public function deleteStorageDataProvider() { return [ // regular case, can properly delete the oc_storages entry @@ -334,11 +337,14 @@ abstract class StoragesServiceTest extends \Test\TestCase { $this->assertCount($expectedCountAfterDeletion, $storages, "expected $expectedCountAfterDeletion storages, got " . json_encode($storages)); } - + protected function actualDeletedUnexistingStorageTest() { + $this->service->removeStorage(255); + } + public function testDeleteUnexistingStorage() { $this->expectException(\OCA\Files_External\NotFoundException::class); - $this->service->removeStorage(255); + $this->actualDeletedUnexistingStorageTest(); } public function testCreateStorage() { diff --git a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php index 83a0d9c7fd7..265da46804a 100644 --- a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php @@ -158,7 +158,7 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { } - + public function testAddStorage($storageParams = null) { $this->expectException(\DomainException::class); @@ -174,7 +174,7 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { $this->service->addStorage($storage); } - + public function testUpdateStorage($storageParams = null) { $this->expectException(\DomainException::class); @@ -194,11 +194,11 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { $this->service->updateStorage($retrievedStorage); } - + public function testNonExistingStorage() { $this->expectException(\DomainException::class); - parent::testNonExistingStorage(); + $this->ActualNonExistingStorageTest(); } /** @@ -222,11 +222,11 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { $this->service->removeStorage($id); } - + public function testDeleteUnexistingStorage() { $this->expectException(\DomainException::class); - parent::testDeleteUnexistingStorage(); + $this->actualDeletedUnexistingStorageTest(); } public function getUniqueStoragesProvider() { |