aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Command/Encryption/SetDefaultModuleTest.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2025-05-02 14:00:10 +0200
committerJoas Schilling <coding@schilljs.com>2025-05-02 16:47:42 +0200
commitc24f5fb256f53836727d3479e0fcf79d680ca2ca (patch)
tree97e2ee14c40ed1cf2237eacd26f69375235e8419 /tests/Core/Command/Encryption/SetDefaultModuleTest.php
parent9a16e4fd1407f0490136f6cfeec184be4b219dce (diff)
downloadnextcloud-server-test/noid/more-phpunit-10.tar.gz
nextcloud-server-test/noid/more-phpunit-10.zip
test: Finish migrating tests/Core/ to PHPUnit 10 compatible codetest/noid/more-phpunit-10
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/Core/Command/Encryption/SetDefaultModuleTest.php')
-rw-r--r--tests/Core/Command/Encryption/SetDefaultModuleTest.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/Core/Command/Encryption/SetDefaultModuleTest.php b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
index 0a2c2a81c28..52f14dd4537 100644
--- a/tests/Core/Command/Encryption/SetDefaultModuleTest.php
+++ b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
@@ -43,7 +43,7 @@ class SetDefaultModuleTest extends TestCase {
}
- public function dataSetDefaultModule() {
+ public static function dataSetDefaultModule(): array {
return [
['ID0', 'ID0', null, null, 'already'],
['ID0', 'ID1', 'ID1', true, 'info'],
@@ -113,12 +113,16 @@ class SetDefaultModuleTest extends TestCase {
->with('maintenance', false)
->willReturn(true);
+ $calls = [
+ 'Maintenance mode must be disabled when setting default module,',
+ 'in order to load the relevant encryption modules correctly.',
+ ];
$this->consoleOutput->expects($this->exactly(2))
->method('writeln')
- ->withConsecutive(
- [$this->stringContains('Maintenance mode must be disabled when setting default module,')],
- [$this->stringContains('in order to load the relevant encryption modules correctly.')],
- );
+ ->willReturnCallback(function ($message) use (&$calls) {
+ $expected = array_shift($calls);
+ $this->assertStringContainsString($expected, $message);
+ });
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}