Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Mar 4, 2024
1 parent afeef5c commit 14c2d19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/ACL/ACLCacheWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
use OCA\GroupFolders\ACL\ACLManager;
use OCP\Constants;
use OCP\Files\Cache\ICache;
use OCP\IDBConnection;
use Test\TestCase;

/**
* @group DB
*/
class ACLCacheWrapperTest extends TestCase {
/** @var ACLManager|\PHPUnit_Framework_MockObject_MockObject */
private $aclManager;
Expand All @@ -43,10 +45,6 @@ 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
3 changes: 3 additions & 0 deletions tests/Folder/FolderManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,13 @@ public function testGetFoldersForGroups() {
* @return \PHPUnit_Framework_MockObject_MockObject|IUser
*/
protected function getUser($groups = []) {
$id = uniqid();
$user = $this->createMock(IUser::class);
$this->groupManager->expects($this->any())
->method('getUserGroupIds')
->willReturn($groups);
$user->method('getUID')
->willReturn($id);

return $user;
}
Expand Down

0 comments on commit 14c2d19

Please sign in to comment.