aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Security
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-28 13:48:58 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-11-02 20:30:37 +0100
commit2c4035e80679b6ebf8e56d86f88701f3ddb65bec (patch)
treea1bd0571d1bc4eab25ad28f4120bfae4582de637 /tests/lib/Security
parentcd13f50a3f1fbcae757672b4a471d8fbcf959b08 (diff)
downloadnextcloud-server-2c4035e80679b6ebf8e56d86f88701f3ddb65bec.tar.gz
nextcloud-server-2c4035e80679b6ebf8e56d86f88701f3ddb65bec.zip
Inject config and logger
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/Security')
-rw-r--r--tests/lib/Security/CredentialsManagerTest.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/lib/Security/CredentialsManagerTest.php b/tests/lib/Security/CredentialsManagerTest.php
index cffcc02817c..38da26a21a9 100644
--- a/tests/lib/Security/CredentialsManagerTest.php
+++ b/tests/lib/Security/CredentialsManagerTest.php
@@ -21,6 +21,8 @@
namespace Test\Security;
+use OC\SystemConfig;
+use OCP\ILogger;
use \OCP\Security\ICrypto;
use \OCP\IDBConnection;
use \OC\Security\CredentialsManager;
@@ -45,7 +47,7 @@ class CredentialsManagerTest extends \Test\TestCase {
$this->manager = new CredentialsManager($this->crypto, $this->dbConnection);
}
- private function getQeuryResult($row) {
+ private function getQueryResult($row) {
$result = $this->getMockBuilder('\Doctrine\DBAL\Driver\Statement')
->disableOriginalConstructor()
->getMock();
@@ -87,12 +89,16 @@ class CredentialsManagerTest extends \Test\TestCase {
->willReturn(json_encode('bar'));
$qb = $this->getMockBuilder('\OC\DB\QueryBuilder\QueryBuilder')
- ->setConstructorArgs([$this->dbConnection])
+ ->setConstructorArgs([
+ $this->dbConnection,
+ $this->createMock(SystemConfig::class),
+ $this->createMock(ILogger::class),
+ ])
->setMethods(['execute'])
->getMock();
$qb->expects($this->once())
->method('execute')
- ->willReturn($this->getQeuryResult(['credentials' => 'baz']));
+ ->willReturn($this->getQueryResult(['credentials' => 'baz']));
$this->dbConnection->expects($this->once())
->method('getQueryBuilder')