diff options
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() { |