]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix PublicKeyTokenProviderTest import and mock 35101/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 10 Nov 2022 14:36:24 +0000 (15:36 +0100)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Fri, 11 Nov 2022 09:39:43 +0000 (09:39 +0000)
* IDBConnection import missing
* Atomic doesn't need a mock

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php

index 2e39bbaa8db358320d0577a55684ab071ad76329..d9135d7e2c4cdbe3017af1d61b96d15cf5be34f5 100644 (file)
@@ -36,6 +36,7 @@ use OC\Authentication\Token\PublicKeyTokenProvider;
 use OCP\AppFramework\Db\DoesNotExistException;
 use OCP\AppFramework\Utility\ITimeFactory;
 use OCP\IConfig;
+use OCP\IDBConnection;
 use OCP\Security\ICrypto;
 use PHPUnit\Framework\MockObject\MockObject;
 use Psr\Log\LoggerInterface;
@@ -50,7 +51,7 @@ class PublicKeyTokenProviderTest extends TestCase {
        private $crypto;
        /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
        private $config;
-       /** @var IDBConnection|IDBConnection|MockObject */
+       /** @var IDBConnection|MockObject */
        private IDBConnection $db;
        /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
        private $logger;
@@ -73,9 +74,6 @@ class PublicKeyTokenProviderTest extends TestCase {
                                ['openssl', [], []],
                        ]);
                $this->db = $this->createMock(IDBConnection::class);
-               $this->db->method('atomic')->willReturnCallback(function ($cb) {
-                       return $cb();
-               });
                $this->logger = $this->createMock(LoggerInterface::class);
                $this->timeFactory = $this->createMock(ITimeFactory::class);
                $this->time = 1313131;