aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Command/User/AuthTokens
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core/Command/User/AuthTokens')
-rw-r--r--tests/Core/Command/User/AuthTokens/DeleteTest.php49
1 files changed, 31 insertions, 18 deletions
diff --git a/tests/Core/Command/User/AuthTokens/DeleteTest.php b/tests/Core/Command/User/AuthTokens/DeleteTest.php
index bd82475b206..6692473c240 100644
--- a/tests/Core/Command/User/AuthTokens/DeleteTest.php
+++ b/tests/Core/Command/User/AuthTokens/DeleteTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -37,11 +38,13 @@ class DeleteTest extends TestCase {
$this->command = new Delete($tokenProvider);
}
- public function testDeleteTokenById() {
+ public function testDeleteTokenById(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
- ->withConsecutive(['uid'], ['id'])
- ->willReturnOnConsecutiveCalls('user', 42);
+ ->willReturnMap([
+ ['uid', 'user'],
+ ['id', '42']
+ ]);
$this->consoleInput->expects($this->once())
->method('getOption')
@@ -56,11 +59,13 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::SUCCESS, $result);
}
- public function testDeleteTokenByIdRequiresTokenId() {
+ public function testDeleteTokenByIdRequiresTokenId(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
- ->withConsecutive(['uid'], ['id'])
- ->willReturnOnConsecutiveCalls('user', null);
+ ->willReturnMap([
+ ['uid', 'user'],
+ ['id', null]
+ ]);
$this->consoleInput->expects($this->once())
->method('getOption')
@@ -75,11 +80,13 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::FAILURE, $result);
}
- public function testDeleteTokensLastUsedBefore() {
+ public function testDeleteTokensLastUsedBefore(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
- ->withConsecutive(['uid'], ['id'])
- ->willReturnOnConsecutiveCalls('user', null);
+ ->willReturnMap([
+ ['uid', 'user'],
+ ['id', null]
+ ]);
$this->consoleInput->expects($this->once())
->method('getOption')
@@ -94,11 +101,13 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::SUCCESS, $result);
}
- public function testLastUsedBeforeAcceptsIso8601Expanded() {
+ public function testLastUsedBeforeAcceptsIso8601Expanded(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
- ->withConsecutive(['uid'], ['id'])
- ->willReturnOnConsecutiveCalls('user', null);
+ ->willReturnMap([
+ ['uid', 'user'],
+ ['id', null]
+ ]);
$this->consoleInput->expects($this->once())
->method('getOption')
@@ -113,11 +122,13 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::SUCCESS, $result);
}
- public function testLastUsedBeforeAcceptsYmd() {
+ public function testLastUsedBeforeAcceptsYmd(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
- ->withConsecutive(['uid'], ['id'])
- ->willReturnOnConsecutiveCalls('user', null);
+ ->willReturnMap([
+ ['uid', 'user'],
+ ['id', null]
+ ]);
$this->consoleInput->expects($this->once())
->method('getOption')
@@ -132,11 +143,13 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::SUCCESS, $result);
}
- public function testIdAndLastUsedBeforeAreMutuallyExclusive() {
+ public function testIdAndLastUsedBeforeAreMutuallyExclusive(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
- ->withConsecutive(['uid'], ['id'])
- ->willReturnOnConsecutiveCalls('user', 42);
+ ->willReturnMap([
+ ['uid', 'user'],
+ ['id', '42']
+ ]);
$this->consoleInput->expects($this->once())
->method('getOption')