aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Command/User/AuthTokens/DeleteTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core/Command/User/AuthTokens/DeleteTest.php')
-rw-r--r--tests/Core/Command/User/AuthTokens/DeleteTest.php37
1 files changed, 25 insertions, 12 deletions
diff --git a/tests/Core/Command/User/AuthTokens/DeleteTest.php b/tests/Core/Command/User/AuthTokens/DeleteTest.php
index 8588c1d5d54..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
@@ -40,8 +41,10 @@ class DeleteTest extends TestCase {
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')
@@ -59,8 +62,10 @@ class DeleteTest extends TestCase {
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')
@@ -78,8 +83,10 @@ class DeleteTest extends TestCase {
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')
@@ -97,8 +104,10 @@ class DeleteTest extends TestCase {
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')
@@ -116,8 +125,10 @@ class DeleteTest extends TestCase {
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')
@@ -135,8 +146,10 @@ class DeleteTest extends TestCase {
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')