Merge pull request #22345 from owncloud/make-note-if-appcodechecker-is-not-enabled
Add note if integrity check is disabled
This commit is contained in:
commit
198d234068
|
@ -87,8 +87,6 @@ class Checker {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isCodeCheckEnforced() {
|
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 = [
|
$signedChannels = [
|
||||||
'daily',
|
'daily',
|
||||||
'testing',
|
'testing',
|
||||||
|
|
|
@ -271,6 +271,10 @@ class CheckSetupController extends Controller {
|
||||||
* @return DataResponse
|
* @return DataResponse
|
||||||
*/
|
*/
|
||||||
public function getFailedIntegrityCheckFiles() {
|
public function getFailedIntegrityCheckFiles() {
|
||||||
|
if(!$this->checker->isCodeCheckEnforced()) {
|
||||||
|
return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.');
|
||||||
|
}
|
||||||
|
|
||||||
$completeResults = $this->checker->getResults();
|
$completeResults = $this->checker->getResults();
|
||||||
|
|
||||||
if(!empty($completeResults)) {
|
if(!empty($completeResults)) {
|
||||||
|
|
|
@ -618,7 +618,22 @@ class CheckSetupControllerTest extends TestCase {
|
||||||
$this->assertEquals($expected, $this->checkSetupController->rescanFailedIntegrityCheck());
|
$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() {
|
public function testGetFailedIntegrityCheckFilesWithNoErrorsFound() {
|
||||||
|
$this->checker
|
||||||
|
->expects($this->once())
|
||||||
|
->method('isCodeCheckEnforced')
|
||||||
|
->willReturn(true);
|
||||||
$this->checker
|
$this->checker
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('getResults')
|
->method('getResults')
|
||||||
|
@ -635,6 +650,10 @@ class CheckSetupControllerTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetFailedIntegrityCheckFilesWithSomeErrorsFound() {
|
public function testGetFailedIntegrityCheckFilesWithSomeErrorsFound() {
|
||||||
|
$this->checker
|
||||||
|
->expects($this->once())
|
||||||
|
->method('isCodeCheckEnforced')
|
||||||
|
->willReturn(true);
|
||||||
$this->checker
|
$this->checker
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('getResults')
|
->method('getResults')
|
||||||
|
|
Loading…
Reference in New Issue