summaryrefslogtreecommitdiffstats
path: root/tests/lib/security
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-01-15 15:18:55 +0100
committerRobin Appelman <icewind@owncloud.com>2016-01-18 12:08:58 +0100
commit7ba715d14418f8cb8703528f7373d76492410e38 (patch)
treedd5feb8ad03a1c739fcf5a8681643cb309f5489e /tests/lib/security
parent7e01f32c27726a50d0f7761dda70b4e34a5e421d (diff)
downloadnextcloud-server-7ba715d14418f8cb8703528f7373d76492410e38.tar.gz
nextcloud-server-7ba715d14418f8cb8703528f7373d76492410e38.zip
fix test
Diffstat (limited to 'tests/lib/security')
-rw-r--r--tests/lib/security/credentialsmanager.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/lib/security/credentialsmanager.php b/tests/lib/security/credentialsmanager.php
index ed8f437e0ac..72f061e05bb 100644
--- a/tests/lib/security/credentialsmanager.php
+++ b/tests/lib/security/credentialsmanager.php
@@ -43,6 +43,18 @@ class CredentialsManagerTest extends \Test\TestCase {
$this->manager = new CredentialsManager($this->crypto, $this->dbConnection);
}
+ private function getQeuryResult($row) {
+ $result = $this->getMockBuilder('\Doctrine\DBAL\Driver\Statement')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $result->expects($this->any())
+ ->method('fetch')
+ ->will($this->returnValue($row));
+
+ return $result;
+ }
+
public function testStore() {
$userId = 'abc';
$identifier = 'foo';
@@ -78,7 +90,7 @@ class CredentialsManagerTest extends \Test\TestCase {
->getMock();
$qb->expects($this->once())
->method('execute')
- ->willReturn(['credentials' => 'baz']);
+ ->willReturn($this->getQeuryResult(['credentials' => 'baz']));
$this->dbConnection->expects($this->once())
->method('getQueryBuilder')