aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Command/User/LastSeenTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core/Command/User/LastSeenTest.php')
-rw-r--r--tests/Core/Command/User/LastSeenTest.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/Core/Command/User/LastSeenTest.php b/tests/Core/Command/User/LastSeenTest.php
index 1146c0664d4..64c710eacc5 100644
--- a/tests/Core/Command/User/LastSeenTest.php
+++ b/tests/Core/Command/User/LastSeenTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -34,11 +35,11 @@ class LastSeenTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OCP\IUserManager $userManager */
+ /** @var IUserManager $userManager */
$this->command = new LastSeen($userManager);
}
- public function validUserLastSeen() {
+ public static function validUserLastSeen(): array {
return [
[0, 'never logged in'],
[time(), 'last login'],
@@ -46,12 +47,12 @@ class LastSeenTest extends TestCase {
}
/**
- * @dataProvider validUserLastSeen
*
* @param int $lastSeen
* @param string $expectedString
*/
- public function testValidUser($lastSeen, $expectedString) {
+ #[\PHPUnit\Framework\Attributes\DataProvider('validUserLastSeen')]
+ public function testValidUser($lastSeen, $expectedString): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$user->expects($this->once())
->method('getLastLogin')
@@ -74,7 +75,7 @@ class LastSeenTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testInvalidUser() {
+ public function testInvalidUser(): void {
$this->userManager->expects($this->once())
->method('get')
->with('user')