Fix external storagestests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
734d496d63
commit
e3e782b63d
|
@ -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() {
|
||||
|
|
|
@ -198,7 +198,7 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest {
|
|||
public function testNonExistingStorage() {
|
||||
$this->expectException(\DomainException::class);
|
||||
|
||||
parent::testNonExistingStorage();
|
||||
$this->ActualNonExistingStorageTest();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -226,7 +226,7 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest {
|
|||
public function testDeleteUnexistingStorage() {
|
||||
$this->expectException(\DomainException::class);
|
||||
|
||||
parent::testDeleteUnexistingStorage();
|
||||
$this->actualDeletedUnexistingStorageTest();
|
||||
}
|
||||
|
||||
public function getUniqueStoragesProvider() {
|
||||
|
|
Loading…
Reference in New Issue