diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-01-08 14:58:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 14:58:43 +0100 |
commit | 81302f78e5cea60dc9064be8ed979d523ff84e18 (patch) | |
tree | 76e8d025c3003e718cf5e04105b782ba8aaa4891 /tests/lib/Security/CredentialsManagerTest.php | |
parent | aeb32e1bc8f50d641e093589cc2f8c90da166768 (diff) | |
parent | 250f76a59cfc865e2a6bd36b690abeed3b529490 (diff) | |
download | nextcloud-server-81302f78e5cea60dc9064be8ed979d523ff84e18.tar.gz nextcloud-server-81302f78e5cea60dc9064be8ed979d523ff84e18.zip |
Merge pull request #24948 from nextcloud/dependabot/composer/doctrine/dbal-3.0.0
Bump doctrine/dbal from 2.12.0 to 3.0.0
Diffstat (limited to 'tests/lib/Security/CredentialsManagerTest.php')
-rw-r--r-- | tests/lib/Security/CredentialsManagerTest.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/lib/Security/CredentialsManagerTest.php b/tests/lib/Security/CredentialsManagerTest.php index 9c1a0cb9291..3ce80227f44 100644 --- a/tests/lib/Security/CredentialsManagerTest.php +++ b/tests/lib/Security/CredentialsManagerTest.php @@ -21,6 +21,7 @@ namespace Test\Security; +use OC\DB\ConnectionAdapter; use OC\Security\CredentialsManager; use OC\SystemConfig; use OCP\IDBConnection; @@ -38,13 +39,19 @@ class CredentialsManagerTest extends \Test\TestCase { /** @var IDBConnection */ protected $dbConnection; + /** @var ConnectionAdapter */ + protected $dbConnectionAdapter; + /** @var CredentialsManager */ protected $manager; protected function setUp(): void { parent::setUp(); $this->crypto = $this->createMock(ICrypto::class); - $this->dbConnection = $this->getMockBuilder('\OC\DB\Connection') + $this->dbConnection = $this->getMockBuilder(IDBConnection::class) + ->disableOriginalConstructor() + ->getMock(); + $this->dbConnectionAdapter = $this->getMockBuilder(ConnectionAdapter::class) ->disableOriginalConstructor() ->getMock(); $this->manager = new CredentialsManager($this->crypto, $this->dbConnection); @@ -91,9 +98,9 @@ class CredentialsManagerTest extends \Test\TestCase { ->with('baz') ->willReturn(json_encode('bar')); - $qb = $this->getMockBuilder('\OC\DB\QueryBuilder\QueryBuilder') + $qb = $this->getMockBuilder(\OC\DB\QueryBuilder\QueryBuilder::class) ->setConstructorArgs([ - $this->dbConnection, + $this->dbConnectionAdapter, $this->createMock(SystemConfig::class), $this->createMock(ILogger::class), ]) @@ -103,7 +110,7 @@ class CredentialsManagerTest extends \Test\TestCase { ->method('execute') ->willReturn($this->getQueryResult(['credentials' => 'baz'])); - $this->dbConnection->expects($this->once()) + $this->dbConnectionAdapter->expects($this->once()) ->method('getQueryBuilder') ->willReturn($qb); |