diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2018-09-13 10:29:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-13 10:29:42 +0300 |
commit | a1c969a17056f14fd165642f6c19cad160e32212 (patch) | |
tree | c4da5745f4ab7909481bcf4f29f92f5eaca2347c /tests | |
parent | 10351cb9daaae22c7d6b5c57299198987e2b3316 (diff) | |
parent | 8d8189c9321ebc4b7049e6060a4d2e3611051aea (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.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(); |