diff options
author | Timo Förster <tfoerster@webfoersterei.de> | 2018-07-27 11:20:47 +0200 |
---|---|---|
committer | Timo Förster <tfoerster@webfoersterei.de> | 2018-08-24 23:12:02 +0200 |
commit | 006e150c879312264db10009792c7035be9562dc (patch) | |
tree | 87d2123babd84d3a109d041671c031bdbcda5ce7 /tests/Settings | |
parent | 9823c7197150e4134490c043c2e2e53733eae783 (diff) | |
download | nextcloud-server-006e150c879312264db10009792c7035be9562dc.tar.gz nextcloud-server-006e150c879312264db10009792c7035be9562dc.zip |
Change check if secure randomness is possible.
Signed-off-by: Timo Förster <tfoerster@webfoersterei.de>
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/Controller/CheckSetupControllerTest.php | 8 |
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(); |