diff --git a/lib/private/integritycheck/checker.php b/lib/private/integritycheck/checker.php index e6f9f9a1457571b11b92627287eee262051637ac..8ede6216b766ebd16d7631d7e256a33ff740e6a8 100644 --- a/lib/private/integritycheck/checker.php +++ b/lib/private/integritycheck/checker.php @@ -87,8 +87,6 @@ class Checker { * @return bool */ public function isCodeCheckEnforced() { - // FIXME: Once the signing server is instructed to sign daily, beta and - // RCs as well these need to be included also. $signedChannels = [ 'daily', 'testing', diff --git a/settings/controller/checksetupcontroller.php b/settings/controller/checksetupcontroller.php index 26194bb11808d28fbb7c422aae08957d9718b4af..cfdfa5021bc9abc86c52f2680201deda8e90fb57 100644 --- a/settings/controller/checksetupcontroller.php +++ b/settings/controller/checksetupcontroller.php @@ -271,6 +271,10 @@ class CheckSetupController extends Controller { * @return DataResponse */ public function getFailedIntegrityCheckFiles() { + if(!$this->checker->isCodeCheckEnforced()) { + return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.'); + } + $completeResults = $this->checker->getResults(); if(!empty($completeResults)) { diff --git a/tests/settings/controller/CheckSetupControllerTest.php b/tests/settings/controller/CheckSetupControllerTest.php index c22ddb2e1209d3ca273a8a04bf364088bce027cd..3ce7c64b4a3a36f3271ad8da64a05f2621ae6e77 100644 --- a/tests/settings/controller/CheckSetupControllerTest.php +++ b/tests/settings/controller/CheckSetupControllerTest.php @@ -618,7 +618,22 @@ class CheckSetupControllerTest extends TestCase { $this->assertEquals($expected, $this->checkSetupController->rescanFailedIntegrityCheck()); } + public function testGetFailedIntegrityCheckDisabled() { + $this->checker + ->expects($this->once()) + ->method('isCodeCheckEnforced') + ->willReturn(false); + + $expected = new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.'); + $this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles()); + } + + public function testGetFailedIntegrityCheckFilesWithNoErrorsFound() { + $this->checker + ->expects($this->once()) + ->method('isCodeCheckEnforced') + ->willReturn(true); $this->checker ->expects($this->once()) ->method('getResults') @@ -635,6 +650,10 @@ class CheckSetupControllerTest extends TestCase { } public function testGetFailedIntegrityCheckFilesWithSomeErrorsFound() { + $this->checker + ->expects($this->once()) + ->method('isCodeCheckEnforced') + ->willReturn(true); $this->checker ->expects($this->once()) ->method('getResults')