diff options
Diffstat (limited to 'tests/lib/security/credentialsmanager.php')
-rw-r--r-- | tests/lib/security/credentialsmanager.php | 14 |
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') |