diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php index d0cb1e00fe891..762933fb254ce 100644 --- a/tests/lib/Comments/ManagerTest.php +++ b/tests/lib/Comments/ManagerTest.php @@ -54,7 +54,14 @@ protected function setUp(): void { $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'; @@ -353,11 +360,11 @@ public function testGetNumberOfUnreadCommentsForFolder(): void { // 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]); + $this->addDatabaseEntry('0', '0', null, null, (string)$fileIds[1]); for ($i = 0; $i < 4; $i++) { - $this->addDatabaseEntry('0', '0', null, null, $fileIds[$i]); + $this->addDatabaseEntry('0', '0', null, null, (string)$fileIds[$i]); } - $this->addDatabaseEntry('0', '0', (new \DateTime())->modify('-2 days'), null, $fileIds[0]); + $this->addDatabaseEntry('0', '0', (new \DateTime())->modify('-2 days'), null, (string)$fileIds[0]); /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */ $user = $this->createMock(IUser::class); $user->expects($this->any()) diff --git a/tests/lib/User/Backend.php b/tests/lib/User/Backend.php index dc5b245fa0678..0a1929be59672 100644 --- a/tests/lib/User/Backend.php +++ b/tests/lib/User/Backend.php @@ -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'); diff --git a/tests/lib/User/DatabaseTest.php b/tests/lib/User/DatabaseTest.php index 0afd54c345c41..e5dbcb8936d39 100644 --- a/tests/lib/User/DatabaseTest.php +++ b/tests/lib/User/DatabaseTest.php @@ -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);