Skip to content

Commit cc83222

Browse files
authored
Merge pull request #35077 from nextcloud/fix/public-key-token-provider-test
Fix PublicKeyTokenProviderTest import and mock
2 parents 96855d7 + 9d0e79f commit cc83222

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use OCP\AppFramework\Db\DoesNotExistException;
3737
use OCP\AppFramework\Utility\ITimeFactory;
3838
use OCP\IConfig;
39+
use OCP\IDBConnection;
3940
use OCP\Security\ICrypto;
4041
use PHPUnit\Framework\MockObject\MockObject;
4142
use Psr\Log\LoggerInterface;
@@ -50,7 +51,7 @@ class PublicKeyTokenProviderTest extends TestCase {
5051
private $crypto;
5152
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
5253
private $config;
53-
/** @var IDBConnection|IDBConnection|MockObject */
54+
/** @var IDBConnection|MockObject */
5455
private IDBConnection $db;
5556
/** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
5657
private $logger;
@@ -73,9 +74,6 @@ protected function setUp(): void {
7374
['openssl', [], []],
7475
]);
7576
$this->db = $this->createMock(IDBConnection::class);
76-
$this->db->method('atomic')->willReturnCallback(function ($cb) {
77-
return $cb();
78-
});
7977
$this->logger = $this->createMock(LoggerInterface::class);
8078
$this->timeFactory = $this->createMock(ITimeFactory::class);
8179
$this->time = 1313131;

0 commit comments

Comments
 (0)