createMock(GlobalStoragesService::class); /** @var UserStoragesService|\PHPUnit\Framework\MockObject\MockObject $userService */ $userService = $this->createMock(UserStoragesService::class); /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject $userManager */ $userManager = $this->createMock(IUserManager::class); /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject $userSession */ $userSession = $this->createMock(IUserSession::class); return new ListCommand($globalService, $userService, $userSession, $userManager); } public function testListAuthIdentifier(): void { $l10n = $this->createMock(IL10N::class); $session = $this->createMock(ISession::class); $crypto = $this->createMock(ICrypto::class); $instance = $this->getInstance(); $mount1 = new StorageConfig(); $mount1->setAuthMechanism(new Password($l10n)); $mount1->setBackend(new Local($l10n, new NullMechanism($l10n))); $mount2 = new StorageConfig(); $credentialStore = $this->createMock(IStore::class); $mount2->setAuthMechanism(new SessionCredentials($l10n, $credentialStore)); $mount2->setBackend(new Local($l10n, new NullMechanism($l10n))); $input = $this->getInput($instance, [], [ 'output' => 'json' ]); $output = new BufferedOutput(); $instance->listMounts('', [$mount1, $mount2], $input, $output); $output = json_decode($output->fetch(), true); $this->assertNotEquals($output[0]['authentication_type'], $output[1]['authentication_type']); } }