summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-07-12 20:20:46 +0200
committerGitHub <noreply@github.com>2017-07-12 20:20:46 +0200
commit6461d083e235025d5a6c8f890949e5ce0b544046 (patch)
tree873ff9d30bcd2ef1b7487abe1d4fd75da5aa9efe /tests
parent35111144d65ec934aaa7ab2196f669887117458d (diff)
parent04f209069859004702ca5138cda3dbcafe4d8c0f (diff)
downloadnextcloud-server-6461d083e235025d5a6c8f890949e5ce0b544046.tar.gz
nextcloud-server-6461d083e235025d5a6c8f890949e5ce0b544046.zip
Merge pull request #4984 from nextcloud/tmpcertfile
Create a temp certfile
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Security/CertificateManagerTest.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php
index 408e65c6766..6bdb647abc5 100644
--- a/tests/lib/Security/CertificateManagerTest.php
+++ b/tests/lib/Security/CertificateManagerTest.php
@@ -12,6 +12,7 @@ use OC\Files\Storage\Temporary;
use \OC\Security\CertificateManager;
use OCP\IConfig;
use OCP\ILogger;
+use OCP\Security\ISecureRandom;
/**
* Class CertificateManagerTest
@@ -26,6 +27,8 @@ class CertificateManagerTest extends \Test\TestCase {
private $certificateManager;
/** @var String */
private $username;
+ /** @var ISecureRandom */
+ private $random;
protected function setUp() {
parent::setUp();
@@ -45,7 +48,17 @@ class CertificateManagerTest extends \Test\TestCase {
$config->expects($this->any())->method('getSystemValue')
->with('installed', false)->willReturn(true);
- $this->certificateManager = new CertificateManager($this->username, new \OC\Files\View(), $config, $this->createMock(ILogger::class));
+ $this->random = $this->createMock(ISecureRandom::class);
+ $this->random->method('generate')
+ ->willReturn('random');
+
+ $this->certificateManager = new CertificateManager(
+ $this->username,
+ new \OC\Files\View(),
+ $config,
+ $this->createMock(ILogger::class),
+ $this->random
+ );
}
protected function tearDown() {
@@ -145,7 +158,7 @@ class CertificateManagerTest extends \Test\TestCase {
/** @var CertificateManager | \PHPUnit_Framework_MockObject_MockObject $certificateManager */
$certificateManager = $this->getMockBuilder('OC\Security\CertificateManager')
- ->setConstructorArgs([$uid, $view, $config, $this->createMock(ILogger::class)])
+ ->setConstructorArgs([$uid, $view, $config, $this->createMock(ILogger::class), $this->random])
->setMethods(['getFilemtimeOfCaBundle', 'getCertificateBundle'])
->getMock();