Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ public function createShare(
?IShareAttributes $attributes = null,
): MockObject {
$share = $this->createMock(IShare::class);
$share->method('getId')->willReturn($id);
$share->method('getId')->willReturn((string)$id);
$share->method('getShareType')->willReturn($shareType);
$share->method('getSharedWith')->willReturn($sharedWith);
$share->method('getSharedBy')->willReturn($sharedBy);
Expand Down Expand Up @@ -1014,11 +1014,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'currentUser',
'node' => $file1,
'id' => 4,
'id' => '4',
];

$file1UserShareOwnerExpected = [
'id' => 4,
'id' => '4',
'share_type' => IShare::TYPE_USER,
];

Expand All @@ -1028,11 +1028,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'currentUser',
'owner' => 'owner',
'node' => $file1,
'id' => 8,
'id' => '8',
];

$file1UserShareInitiatorExpected = [
'id' => 8,
'id' => '8',
'share_type' => IShare::TYPE_USER,
];

Expand All @@ -1042,11 +1042,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'owner',
'node' => $file1,
'id' => 15,
'id' => '15',
];

$file1UserShareRecipientExpected = [
'id' => 15,
'id' => '15',
'share_type' => IShare::TYPE_USER,
];

Expand All @@ -1056,11 +1056,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'owner',
'node' => $file1,
'id' => 16,
'id' => '16',
];

$file1UserShareOtherExpected = [
'id' => 16,
'id' => '16',
'share_type' => IShare::TYPE_USER,
];

Expand All @@ -1070,11 +1070,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'currentUser',
'node' => $file1,
'id' => 23,
'id' => '23',
];

$file1GroupShareOwnerExpected = [
'id' => 23,
'id' => '23',
'share_type' => IShare::TYPE_GROUP,
];

Expand All @@ -1084,11 +1084,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'owner',
'node' => $file1,
'id' => 42,
'id' => '42',
];

$file1GroupShareRecipientExpected = [
'id' => 42,
'id' => '42',
'share_type' => IShare::TYPE_GROUP,
];

Expand All @@ -1098,7 +1098,7 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'owner',
'node' => $file1,
'id' => 108,
'id' => '108',
];

$file1LinkShareOwner = [
Expand All @@ -1107,11 +1107,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'currentUser',
'node' => $file1,
'id' => 415,
'id' => '415',
];

$file1LinkShareOwnerExpected = [
'id' => 415,
'id' => '415',
'share_type' => IShare::TYPE_LINK,
];

Expand All @@ -1121,11 +1121,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'currentUser',
'node' => $file1,
'id' => 416,
'id' => '416',
];

$file1EmailShareOwnerExpected = [
'id' => 416,
'id' => '416',
'share_type' => IShare::TYPE_EMAIL,
];

Expand All @@ -1135,11 +1135,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'currentUser',
'node' => $file1,
'id' => 423,
'id' => '423',
];

$file1CircleShareOwnerExpected = [
'id' => 423,
'id' => '423',
'share_type' => IShare::TYPE_CIRCLE,
];

Expand All @@ -1149,11 +1149,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'currentUser',
'node' => $file1,
'id' => 442,
'id' => '442',
];

$file1RoomShareOwnerExpected = [
'id' => 442,
'id' => '442',
'share_type' => IShare::TYPE_ROOM,
];

Expand All @@ -1164,11 +1164,11 @@ public static function dataGetShares(): array {
'owner' => 'currentUser',
'expirationDate' => new \DateTime('2000-01-01T01:02:03'),
'node' => $file1,
'id' => 815,
'id' => '815',
];

$file1RemoteShareOwnerExpected = [
'id' => 815,
'id' => '815',
'share_type' => IShare::TYPE_REMOTE,
];

Expand All @@ -1179,11 +1179,11 @@ public static function dataGetShares(): array {
'owner' => 'currentUser',
'expirationDate' => new \DateTime('2000-01-01T01:02:03'),
'node' => $file1,
'id' => 816,
'id' => '816',
];

$file1RemoteGroupShareOwnerExpected = [
'id' => 816,
'id' => '816',
'share_type' => IShare::TYPE_REMOTE_GROUP,
];

Expand All @@ -1193,11 +1193,11 @@ public static function dataGetShares(): array {
'sharedBy' => 'initiator',
'owner' => 'currentUser',
'node' => $file2,
'id' => 823,
'id' => '823',
];

$file2UserShareOwnerExpected = [
'id' => 823,
'id' => '823',
'share_type' => IShare::TYPE_USER,
];

Expand Down Expand Up @@ -1540,7 +1540,7 @@ function (array $shareParams): IShare {
->setSharedBy($shareParams['sharedBy'])
->setShareOwner($shareParams['owner'])
->setPermissions(Constants::PERMISSION_READ)
->setId($shareParams['id']);
->setId((string)$shareParams['id']);
if (isset($shareParams['sharedWith'])) {
$share->setSharedWith($shareParams['sharedWith']);
}
Expand Down Expand Up @@ -5338,8 +5338,8 @@ public function testFormatShareWithFederatedShare(bool $isKnownServer, bool $isT
1,
IShare::TYPE_REMOTE,
'[email protected]', // shared with
'[email protected]', // shared by
'shareOwner', // share owner
'[email protected]', // shared by
'shareOwner', // share owner
$node,
Constants::PERMISSION_READ,
time(),
Expand Down
8 changes: 0 additions & 8 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4147,14 +4147,6 @@
<code><![CDATA[getProviderForType]]></code>
</InvalidReturnType>
</file>
<file src="lib/private/Share20/Share.php">
<LessSpecificReturnStatement>
<code><![CDATA[$this->node]]></code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code><![CDATA[getNode]]></code>
</MoreSpecificReturnType>
</file>
<file src="lib/private/Streamer.php">
<UndefinedInterfaceMethod>
<code><![CDATA[get]]></code>
Expand Down
Loading
Loading