]> source.dussan.org Git - nextcloud-server.git/commitdiff
test: Fix mock creation
authorJoas Schilling <coding@schilljs.com>
Wed, 2 Oct 2024 22:27:52 +0000 (00:27 +0200)
committerJoas Schilling <coding@schilljs.com>
Mon, 7 Oct 2024 10:11:30 +0000 (12:11 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
tests/Core/Command/User/SettingTest.php

index 6848b0bb350aeb7db51a5e87c1cc23dad3d8c8fc..95d1c192b81dfe83e8832d5e75abee15960e4f74 100644 (file)
@@ -49,15 +49,14 @@ class SettingTest extends TestCase {
 
        public function getCommand(array $methods = []) {
                if (empty($methods)) {
-                       return new Setting($this->userManager, $this->config, $this->connection);
+                       return new Setting($this->userManager, $this->config);
                } else {
-                       $mock = $this->getMockBuilder('OC\Core\Command\User\Setting')
+                       $mock = $this->getMockBuilder(Setting::class)
                                ->setConstructorArgs([
                                        $this->userManager,
                                        $this->config,
-                                       $this->connection,
                                ])
-                               ->setMethods($methods)
+                               ->onlyMethods($methods)
                                ->getMock();
                        return $mock;
                }