Skip to content

Commit 3256cdf

Browse files
committed
chore: update psalm baseline
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 1f8f95d commit 3256cdf

2 files changed

Lines changed: 30 additions & 14 deletions

File tree

tests/FilesHooksTest.php

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,36 @@ public static function dataFileCreate(): array {
184184

185185
/**
186186
* @dataProvider dataFileCreate
187-
*
188-
* @param mixed $currentUser
189-
* @param string $selfSubject
190-
* @param string $othersSubject
191187
*/
192-
public function testFileCreate(string $currentUser, string $selfSubject, string $othersSubject, string $type): void {
193-
$filesHooks = $this->getFilesHooks([
194-
'addNotificationsForFileAction',
195-
], $currentUser);
188+
public function testFileCreate(string $currentUser, bool $isPublicShare, string $selfSubject, string $othersSubject, string $type): void {
189+
$currentUserMock = $this->createMock(CurrentUser::class);
190+
$currentUserMock->method('getUID')->willReturn($currentUser);
191+
$currentUserMock->method('getUserIdentifier')->willReturn($currentUser);
192+
$currentUserMock->method('isPublicShareToken')->willReturn($isPublicShare);
193+
194+
$logger = $this->createMock(LoggerInterface::class);
195+
196+
$filesHooks = $this->getMockBuilder(FilesHooks::class)
197+
->setConstructorArgs([
198+
$this->activityManager,
199+
$this->data,
200+
$this->settings,
201+
$this->groupManager,
202+
$this->view,
203+
$this->rootFolder,
204+
$this->shareHelper,
205+
\OCP\Server::get(IDBConnection::class),
206+
$this->urlGenerator,
207+
$logger,
208+
$currentUserMock,
209+
$this->userMountCache,
210+
$this->config,
211+
$this->notificationGenerator,
212+
$this->tagManager,
213+
$this->teamManager,
214+
])
215+
->onlyMethods(['addNotificationsForFileAction'])
216+
->getMock();
196217

197218
$filesHooks->expects($this->once())
198219
->method('addNotificationsForFileAction')

tests/psalm-baseline.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="6.12.1@e71404b0465be25cf7f8a631b298c01c5ddd864f">
2+
<files psalm-version="6.15.1@28dc127af1b5aecd52314f6f645bafc10d0e11f9">
33
<file src="lib/BackgroundJob/RemoteActivity.php">
44
<UndefinedClass>
55
<code><![CDATA[ClientException]]></code>
66
</UndefinedClass>
77
</file>
8-
<file src="lib/CurrentUser.php">
9-
<NoInterfaceProperties>
10-
<code><![CDATA[$this->request->server]]></code>
11-
</NoInterfaceProperties>
12-
</file>
138
<file src="lib/Data.php">
149
<UndefinedDocblockClass>
1510
<code><![CDATA[$favoriteFilter->filterFavorites($query);]]></code>

0 commit comments

Comments
 (0)