Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2018-09-13 10:29:42 +0300
committerGitHub <noreply@github.com>2018-09-13 10:29:42 +0300
commita1c969a17056f14fd165642f6c19cad160e32212 (patch)
treec4da5745f4ab7909481bcf4f29f92f5eaca2347c /tests
parent10351cb9daaae22c7d6b5c57299198987e2b3316 (diff)
parent8d8189c9321ebc4b7049e6060a4d2e3611051aea (diff)
Merge pull request #10840 from webfoersterei/refactor/5530-urandom-check
Refactor secure randomness check
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Controller/CheckSetupControllerTest.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/Settings/Controller/CheckSetupControllerTest.php b/tests/Settings/Controller/CheckSetupControllerTest.php
index cc1ed6555c3..6706573a1ad 100644
--- a/tests/Settings/Controller/CheckSetupControllerTest.php
+++ b/tests/Settings/Controller/CheckSetupControllerTest.php
@@ -24,6 +24,7 @@ namespace Tests\Settings\Controller;
use OC;
use OC\DB\Connection;
use OC\MemoryInfo;
+use OC\Security\SecureRandom;
use OC\Settings\Controller\CheckSetupController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataDisplayResponse;
@@ -79,6 +80,8 @@ class CheckSetupControllerTest extends TestCase {
private $dateTimeFormatter;
/** @var MemoryInfo|MockObject */
private $memoryInfo;
+ /** @var SecureRandom|\PHPUnit_Framework_MockObject_MockObject */
+ private $secureRandom;
/**
* Holds a list of directories created during tests.
@@ -119,6 +122,7 @@ class CheckSetupControllerTest extends TestCase {
$this->memoryInfo = $this->getMockBuilder(MemoryInfo::class)
->setMethods(['isMemoryLimitSufficient',])
->getMock();
+ $this->secureRandom = $this->getMockBuilder(SecureRandom::class)->getMock();
$this->checkSetupController = $this->getMockBuilder('\OC\Settings\Controller\CheckSetupController')
->setConstructorArgs([
'settings',
@@ -135,6 +139,7 @@ class CheckSetupControllerTest extends TestCase {
$this->lockingProvider,
$this->dateTimeFormatter,
$this->memoryInfo,
+ $this->secureRandom,
])
->setMethods([
'isReadOnlyConfig',
@@ -482,7 +487,7 @@ class CheckSetupControllerTest extends TestCase {
'serverHasInternetConnection' => false,
'isMemcacheConfigured' => true,
'memcacheDocs' => 'http://docs.example.org/server/go.php?to=admin-performance',
- 'isUrandomAvailable' => self::invokePrivate($this->checkSetupController, 'isUrandomAvailable'),
+ 'isRandomnessSecure' => self::invokePrivate($this->checkSetupController, 'isRandomnessSecure'),
'securityDocs' => 'https://docs.example.org/server/8.1/admin_manual/configuration_server/hardening.html',
'isUsedTlsLibOutdated' => '',
'phpSupported' => [
@@ -528,6 +533,7 @@ class CheckSetupControllerTest extends TestCase {
$this->lockingProvider,
$this->dateTimeFormatter,
$this->memoryInfo,
+ $this->secureRandom,
])
->setMethods(null)->getMock();