Skip to content

Commit 9808cc4

Browse files
committed
Try to unregirster share backend after each test
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
1 parent 0233977 commit 9808cc4

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

apps/files_sharing/tests/SharedStorageTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ protected function tearDown(): void {
7171

7272
\OC\Files\Filesystem::getLoader()->removeStorageWrapper('oc_trashbin');
7373

74+
\OC\Share\Share::unregisterBackend('file');
75+
\OC\Share\Share::unregisterBackend('folder');
76+
7477
parent::tearDown();
7578
}
7679

lib/private/Share/Share.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ public static function registerBackend($itemType, $class, $collectionOf = null,
9191
return false;
9292
}
9393

94+
/**
95+
* Unregister a sharing backend
96+
* @param string $itemType Item type
97+
* @internal FOR TESTING ONLY
98+
*/
99+
public static function unregisterBackend($itemType) {
100+
unset(self::$backendTypes[$itemType]);
101+
}
102+
94103
/**
95104
* Get the items of item type shared with the current user
96105
* @param string $itemType

0 commit comments

Comments
 (0)