Skip to content

Commit

Permalink
Merge pull request #1543 from nextcloud/test/1537/database-deps
Browse files Browse the repository at this point in the history
Mock database dependency as it is being pulled in by the CacheWrapper
  • Loading branch information
juliusknorr authored Jun 17, 2021
2 parents 7f25c64 + f65d32b commit b6ef686
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/ACL/ACLCacheWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use OCA\GroupFolders\ACL\ACLManager;
use OCP\Constants;
use OCP\Files\Cache\ICache;
use OCP\IDBConnection;
use Test\TestCase;

class ACLCacheWrapperTest extends TestCase {
Expand All @@ -40,6 +41,10 @@ class ACLCacheWrapperTest extends TestCase {
protected function setUp(): void {
parent::setUp();

\OC::$server->registerService(IDBConnection::class, function () {
return $this->createMock(IDBConnection::class);
});

$this->aclManager = $this->createMock(ACLManager::class);
$this->aclManager->method('getACLPermissionsForPath')
->willReturnCallback(function (string $path) {
Expand Down

0 comments on commit b6ef686

Please sign in to comment.