Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Feb 26, 2024
1 parent 8241819 commit 6f1fe2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/ACL/ACLCacheWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
use OCP\IDBConnection;
use Test\TestCase;

/**
* @group DB
*/
class ACLCacheWrapperTest extends TestCase {
/** @var ACLManager|\PHPUnit_Framework_MockObject_MockObject */
private $aclManager;
Expand All @@ -43,10 +46,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 6f1fe2d

Please sign in to comment.