Skip to content
Open
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
9 changes: 8 additions & 1 deletion tests/lib/Comments/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@
$this->connection->prepare($sql)->execute();
}

protected function addDatabaseEntry(?string $parentId, ?string $topmostParentId, ?\DateTimeInterface $creationDT = null, ?\DateTimeInterface $latestChildDT = null, $objectId = null, ?\DateTimeInterface $expireDate = null): string {
protected function addDatabaseEntry(
?string $parentId,
?string $topmostParentId,
?\DateTimeInterface $creationDT = null,
?\DateTimeInterface $latestChildDT = null,
?string $objectId = null,
?\DateTimeInterface $expireDate = null
): string {
$creationDT ??= new \DateTime();
$latestChildDT ??= new \DateTime('yesterday');
$objectId ??= 'file64';
Expand Down Expand Up @@ -353,11 +360,11 @@
// 2 comments for 1112 with no read marker
// 1 comment for 1113 before read marker
// 1 comment for 1114 with no read marker
$this->addDatabaseEntry('0', '0', null, null, $fileIds[1]);

Check failure on line 363 in tests/lib/Comments/ManagerTest.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

InvalidArgument

tests/lib/Comments/ManagerTest.php:363:49: InvalidArgument: Argument 5 of Test\Comments\ManagerTest::addDatabaseEntry expects null|string, but int provided (see https://psalm.dev/004)
for ($i = 0; $i < 4; $i++) {
$this->addDatabaseEntry('0', '0', null, null, $fileIds[$i]);

Check failure on line 365 in tests/lib/Comments/ManagerTest.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

InvalidArgument

tests/lib/Comments/ManagerTest.php:365:50: InvalidArgument: Argument 5 of Test\Comments\ManagerTest::addDatabaseEntry expects null|string, but int provided (see https://psalm.dev/004)
}
$this->addDatabaseEntry('0', '0', (new \DateTime())->modify('-2 days'), null, $fileIds[0]);

Check failure on line 367 in tests/lib/Comments/ManagerTest.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

InvalidArgument

tests/lib/Comments/ManagerTest.php:367:81: InvalidArgument: Argument 5 of Test\Comments\ManagerTest::addDatabaseEntry expects null|string, but int provided (see https://psalm.dev/004)
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
$user = $this->createMock(IUser::class);
$user->expects($this->any())
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/User/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ public function testLogin(): void {
}

public function testSearch(): void {
$name1 = 'foobarbaz';
$name2 = 'bazbarfoo';
$name3 = 'notme';
$name4 = 'under_score';
$name1 = $this->getUser() . 'foobarbaz';
$name2 = $this->getUser() . 'bazbarfoo';
$name3 = $this->getUser() . 'notme';
$name4 = $this->getUser() . 'under_score';

$this->backend->createUser($name1, 'pass1');
$this->backend->createUser($name2, 'pass2');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/User/DatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ function (Event $event): void {
}

public function testCreateUserInvalidatesCache(): void {
$user1 = $this->getUniqueID('test_');
$user1 = $this->getUser();
$this->assertFalse($this->backend->userExists($user1));
$this->backend->createUser($user1, 'pw');
$this->assertTrue($this->backend->userExists($user1));
}

public function testDeleteUserInvalidatesCache(): void {
$user1 = $this->getUniqueID('test_');
$user1 = $this->getUser();
$this->backend->createUser($user1, 'pw');
$this->assertTrue($this->backend->userExists($user1));
$this->backend->deleteUser($user1);
Expand Down
Loading