Skip to content

Commit bc51800

Browse files
committed
update psalm stubs and unit tests
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
1 parent 530539d commit bc51800

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

tests/stub.phpstub

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ namespace OCA\Circles\Model {
7373

7474
public function getLevel(): int {}
7575
public function getUserType(): int{}
76+
public function getUserId(): string {}
7677
}
7778

7879
class Circle {
7980
public function getUniqueId(): string {}
8081
public function getDisplayName(): string {}
8182
public function getOwner(): string {}
8283
public function getSingleId(): string {}
84+
/** @return Member[] */
85+
public function getMembers(int $limit = 0): array {}
8386
public function getInheritedMembers(): array {}
8487
public function getInitiator(): Member {}
8588
}
@@ -93,6 +96,11 @@ namespace OCA\Circles\Events {
9396
public function __construct(FederatedEvent $federatedEvent, array $results) {}
9497
abstract public function getCircle(): \OCA\Circles\Model\Circle {}
9598
}
99+
100+
class RemovingCircleMemberEvent extends \OCP\EventDispatcher\Event {
101+
public function getCircle(): \OCA\Circles\Model\Circle {}
102+
public function getMember(): \OCA\Circles\Model\Member {}
103+
}
96104
}
97105
namespace OCA\Circles\Model\Probes {
98106
class CircleProbe {

tests/unit/Db/BoardTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public function testJsonSerialize() {
3535
'activeSessions' => [],
3636
'ETag' => $board->getETag(),
3737
'shareToken' => null,
38-
'externalId' => null
38+
'externalId' => null,
39+
'teamId' => null,
3940
], $board->jsonSerialize());
4041
}
4142

@@ -61,7 +62,8 @@ public function testUnfetchedValues() {
6162
'activeSessions' => [],
6263
'ETag' => $board->getETag(),
6364
'shareToken' => null,
64-
'externalId' => null
65+
'externalId' => null,
66+
'teamId' => null,
6567
], $board->jsonSerialize());
6668
}
6769

@@ -85,7 +87,8 @@ public function testSetLabels() {
8587
'activeSessions' => [],
8688
'ETag' => $board->getETag(),
8789
'shareToken' => null,
88-
'externalId' => null
90+
'externalId' => null,
91+
'teamId' => null,
8992
], $board->jsonSerialize());
9093
}
9194
public function testSetAcl() {
@@ -117,7 +120,8 @@ public function testSetShared() {
117120
'activeSessions' => [],
118121
'ETag' => $board->getETag(),
119122
'shareToken' => null,
120-
'externalId' => null
123+
'externalId' => null,
124+
'teamId' => null,
121125
], $board->jsonSerialize());
122126
}
123127
}

tests/unit/Service/BoardServiceTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
use OC\Federation\CloudIdManager;
3232
use OC\L10N\L10N;
3333
use OC\Security\SecureRandom;
34-
use OCA\Circles\Model\Circle;
3534
use OCA\Deck\Activity\ActivityManager;
3635
use OCA\Deck\BadRequestException;
3736
use OCA\Deck\Db\Acl;
@@ -265,7 +264,7 @@ public function testCreateForTeamNotMember(): void {
265264
$this->circlesService->expects($this->once())
266265
->method('getCircle')
267266
->with('team-a')
268-
->willReturn($this->createMock(Circle::class));
267+
->willReturn(new \stdClass());
269268
$this->circlesService->expects($this->once())
270269
->method('isUserInCircle')
271270
->with('team-a', $this->userId)
@@ -294,7 +293,7 @@ public function testCreateForTeamSuccess(): void {
294293
$this->circlesService->expects($this->once())
295294
->method('getCircle')
296295
->with('team-a')
297-
->willReturn($this->createMock(Circle::class));
296+
->willReturn(new \stdClass());
298297
$this->circlesService->expects($this->once())
299298
->method('isUserInCircle')
300299
->with('team-a', $this->userId)

0 commit comments

Comments
 (0)