Handle strict typing in Checker and fix tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/8472/head
Roeland Jago Douma 8 years ago
parent 4d5f2e64a5
commit 72e745be26
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 7
      lib/private/IntegrityCheck/Checker.php
  2. 3
      tests/lib/IntegrityCheck/CheckerTest.php

@ -333,7 +333,12 @@ class Checker {
return [];
}
$signatureData = json_decode($this->fileAccessHelper->file_get_contents($signaturePath), true);
$content = $this->fileAccessHelper->file_get_contents($signaturePath);
$signatureData = null;
if (\is_string($content)) {
$signatureData = json_decode($content, true);
}
if(!\is_array($signatureData)) {
throw new InvalidSignatureException('Signature data not found.');
}

@ -58,6 +58,9 @@ class CheckerTest extends TestCase {
$this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->appManager = $this->createMock(IAppManager::class);
$this->config->method('getAppValue')
->will($this->returnArgument(2));
$this->cacheFactory
->expects($this->any())
->method('createDistributed')

Loading…
Cancel
Save