aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoryemkareems <yemkareems@gmail.com>2024-10-28 15:04:11 +0530
committeryemkareems <yemkareems@gmail.com>2024-10-28 15:04:11 +0530
commita74ef8237da49b75a930ca335713eef0347c9d51 (patch)
tree8f406854b99fd06b3f4a9568e72b151c1eaca529 /tests
parent505dfd65fd3520aaf95add30ef680723ddcd4dbd (diff)
downloadnextcloud-server-a74ef8237da49b75a930ca335713eef0347c9d51.tar.gz
nextcloud-server-a74ef8237da49b75a930ca335713eef0347c9d51.zip
fix: crypto type made not nullable and tests run using ICrypto
Signed-off-by: yemkareems <yemkareems@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Authentication/LoginCredentials/StoreTest.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/lib/Authentication/LoginCredentials/StoreTest.php b/tests/lib/Authentication/LoginCredentials/StoreTest.php
index 0a9a133746e..c58bb09faaa 100644
--- a/tests/lib/Authentication/LoginCredentials/StoreTest.php
+++ b/tests/lib/Authentication/LoginCredentials/StoreTest.php
@@ -13,7 +13,6 @@ use OC\Authentication\LoginCredentials\Credentials;
use OC\Authentication\LoginCredentials\Store;
use OC\Authentication\Token\IProvider;
use OC\Authentication\Token\IToken;
-use OC\Security\Crypto;
use OCP\Authentication\Exceptions\CredentialsUnavailableException;
use OCP\ISession;
use OCP\Security\ICrypto;
@@ -43,9 +42,9 @@ class StoreTest extends TestCase {
$this->session = $this->createMock(ISession::class);
$this->tokenProvider = $this->createMock(IProvider::class);
$this->logger = $this->createMock(LoggerInterface::class);
- $this->crypto = $this->createMock(Crypto::class);
+ $this->crypto = $this->createMock(ICrypto::class);
- $this->store = new Store($this->session, $this->logger, $this->tokenProvider, $this->crypto);
+ $this->store = new Store($this->session, $this->logger, $this->crypto, $this->tokenProvider);
}
public function testAuthenticate(): void {
@@ -60,7 +59,7 @@ class StoreTest extends TestCase {
->with($this->equalTo('login_credentials'), $this->equalTo(json_encode($params)));
$this->crypto->expects($this->once())
->method('encrypt')
- ->willReturn($params['password']);
+ ->willReturn('123456');
$this->store->authenticate($params);
}
@@ -73,7 +72,7 @@ class StoreTest extends TestCase {
}
public function testGetLoginCredentialsNoTokenProvider(): void {
- $this->store = new Store($this->session, $this->logger, null, $this->crypto);
+ $this->store = new Store($this->session, $this->logger, $this->crypto, null);
$this->expectException(CredentialsUnavailableException::class);