diff options
Diffstat (limited to 'tests/lib/Security/CertificateManagerTest.php')
-rw-r--r-- | tests/lib/Security/CertificateManagerTest.php | 17 |
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(); |