You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CheckSetupControllerTest.php 44KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255
  1. <?php
  2. /**
  3. * @author Lukas Reschke <lukas@owncloud.com>
  4. *
  5. * @copyright Copyright (c) 2015, ownCloud, Inc.
  6. * @license AGPL-3.0
  7. *
  8. * This code is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License, version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License, version 3,
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>
  19. *
  20. */
  21. namespace Tests\Settings\Controller;
  22. use OC;
  23. use OC\DB\Connection;
  24. use OC\MemoryInfo;
  25. use OC\Settings\Controller\CheckSetupController;
  26. use OCP\AppFramework\Http;
  27. use OCP\AppFramework\Http\DataDisplayResponse;
  28. use OCP\AppFramework\Http\DataResponse;
  29. use OCP\AppFramework\Http\RedirectResponse;
  30. use OCP\Http\Client\IClientService;
  31. use OCP\IConfig;
  32. use OCP\IDateTimeFormatter;
  33. use OCP\IL10N;
  34. use OCP\ILogger;
  35. use OCP\IRequest;
  36. use OCP\IURLGenerator;
  37. use OC_Util;
  38. use OCP\Lock\ILockingProvider;
  39. use PHPUnit\Framework\MockObject\MockObject;
  40. use Psr\Http\Message\ResponseInterface;
  41. use Symfony\Component\EventDispatcher\EventDispatcher;
  42. use Test\TestCase;
  43. use OC\IntegrityCheck\Checker;
  44. /**
  45. * Class CheckSetupControllerTest
  46. *
  47. * @backupStaticAttributes
  48. * @package Tests\Settings\Controller
  49. */
  50. class CheckSetupControllerTest extends TestCase {
  51. /** @var CheckSetupController | \PHPUnit_Framework_MockObject_MockObject */
  52. private $checkSetupController;
  53. /** @var IRequest | \PHPUnit_Framework_MockObject_MockObject */
  54. private $request;
  55. /** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */
  56. private $config;
  57. /** @var IClientService | \PHPUnit_Framework_MockObject_MockObject*/
  58. private $clientService;
  59. /** @var IURLGenerator | \PHPUnit_Framework_MockObject_MockObject */
  60. private $urlGenerator;
  61. /** @var OC_Util */
  62. private $util;
  63. /** @var IL10N | \PHPUnit_Framework_MockObject_MockObject */
  64. private $l10n;
  65. /** @var ILogger */
  66. private $logger;
  67. /** @var Checker|\PHPUnit_Framework_MockObject_MockObject */
  68. private $checker;
  69. /** @var EventDispatcher|\PHPUnit_Framework_MockObject_MockObject */
  70. private $dispatcher;
  71. /** @var Connection|\PHPUnit_Framework_MockObject_MockObject */
  72. private $db;
  73. /** @var ILockingProvider|\PHPUnit_Framework_MockObject_MockObject */
  74. private $lockingProvider;
  75. /** @var IDateTimeFormatter|\PHPUnit_Framework_MockObject_MockObject */
  76. private $dateTimeFormatter;
  77. /** @var MemoryInfo|MockObject */
  78. private $memoryInfo;
  79. /**
  80. * Holds a list of directories created during tests.
  81. *
  82. * @var array
  83. */
  84. private $dirsToRemove = [];
  85. public function setUp() {
  86. parent::setUp();
  87. $this->request = $this->getMockBuilder(IRequest::class)
  88. ->disableOriginalConstructor()->getMock();
  89. $this->config = $this->getMockBuilder(IConfig::class)
  90. ->disableOriginalConstructor()->getMock();
  91. $this->clientService = $this->getMockBuilder(IClientService::class)
  92. ->disableOriginalConstructor()->getMock();
  93. $this->util = $this->getMockBuilder('\OC_Util')
  94. ->disableOriginalConstructor()->getMock();
  95. $this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)
  96. ->disableOriginalConstructor()->getMock();
  97. $this->l10n = $this->getMockBuilder(IL10N::class)
  98. ->disableOriginalConstructor()->getMock();
  99. $this->l10n->expects($this->any())
  100. ->method('t')
  101. ->will($this->returnCallback(function($message, array $replace) {
  102. return vsprintf($message, $replace);
  103. }));
  104. $this->dispatcher = $this->getMockBuilder(EventDispatcher::class)
  105. ->disableOriginalConstructor()->getMock();
  106. $this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker')
  107. ->disableOriginalConstructor()->getMock();
  108. $this->logger = $this->getMockBuilder(ILogger::class)->getMock();
  109. $this->db = $this->getMockBuilder(Connection::class)
  110. ->disableOriginalConstructor()->getMock();
  111. $this->lockingProvider = $this->getMockBuilder(ILockingProvider::class)->getMock();
  112. $this->dateTimeFormatter = $this->getMockBuilder(IDateTimeFormatter::class)->getMock();
  113. $this->memoryInfo = $this->getMockBuilder(MemoryInfo::class)
  114. ->setMethods(['isMemoryLimitSufficient',])
  115. ->getMock();
  116. $this->checkSetupController = $this->getMockBuilder('\OC\Settings\Controller\CheckSetupController')
  117. ->setConstructorArgs([
  118. 'settings',
  119. $this->request,
  120. $this->config,
  121. $this->clientService,
  122. $this->urlGenerator,
  123. $this->util,
  124. $this->l10n,
  125. $this->checker,
  126. $this->logger,
  127. $this->dispatcher,
  128. $this->db,
  129. $this->lockingProvider,
  130. $this->dateTimeFormatter,
  131. $this->memoryInfo,
  132. ])
  133. ->setMethods([
  134. 'isReadOnlyConfig',
  135. 'hasValidTransactionIsolationLevel',
  136. 'hasFileinfoInstalled',
  137. 'hasWorkingFileLocking',
  138. 'getLastCronInfo',
  139. 'getSuggestedOverwriteCliURL',
  140. 'getOutdatedCaches',
  141. 'getCurlVersion',
  142. 'isPhpOutdated',
  143. 'isOpcacheProperlySetup',
  144. 'hasFreeTypeSupport',
  145. 'hasMissingIndexes',
  146. 'isSqliteUsed',
  147. 'isPhpMailerUsed',
  148. 'hasOpcacheLoaded',
  149. 'getAppDirsWithDifferentOwner',
  150. ])->getMock();
  151. }
  152. /**
  153. * Removes directories created during tests.
  154. *
  155. * @after
  156. * @return void
  157. */
  158. public function removeTestDirectories() {
  159. foreach ($this->dirsToRemove as $dirToRemove) {
  160. rmdir($dirToRemove);
  161. }
  162. $this->dirsToRemove = [];
  163. }
  164. public function testIsInternetConnectionWorkingDisabledViaConfig() {
  165. $this->config->expects($this->once())
  166. ->method('getSystemValue')
  167. ->with('has_internet_connection', true)
  168. ->will($this->returnValue(false));
  169. $this->assertFalse(
  170. self::invokePrivate(
  171. $this->checkSetupController,
  172. 'isInternetConnectionWorking'
  173. )
  174. );
  175. }
  176. public function testIsInternetConnectionWorkingCorrectly() {
  177. $this->config->expects($this->once())
  178. ->method('getSystemValue')
  179. ->with('has_internet_connection', true)
  180. ->will($this->returnValue(true));
  181. $client = $this->getMockBuilder('\OCP\Http\Client\IClient')
  182. ->disableOriginalConstructor()->getMock();
  183. $client->expects($this->any())
  184. ->method('get');
  185. $this->clientService->expects($this->once())
  186. ->method('newClient')
  187. ->will($this->returnValue($client));
  188. $this->assertTrue(
  189. self::invokePrivate(
  190. $this->checkSetupController,
  191. 'isInternetConnectionWorking'
  192. )
  193. );
  194. }
  195. public function testIsInternetConnectionFail() {
  196. $this->config->expects($this->once())
  197. ->method('getSystemValue')
  198. ->with('has_internet_connection', true)
  199. ->will($this->returnValue(true));
  200. $client = $this->getMockBuilder('\OCP\Http\Client\IClient')
  201. ->disableOriginalConstructor()->getMock();
  202. $client->expects($this->any())
  203. ->method('get')
  204. ->will($this->throwException(new \Exception()));
  205. $this->clientService->expects($this->exactly(4))
  206. ->method('newClient')
  207. ->will($this->returnValue($client));
  208. $this->assertFalse(
  209. self::invokePrivate(
  210. $this->checkSetupController,
  211. 'isInternetConnectionWorking'
  212. )
  213. );
  214. }
  215. public function testIsMemcacheConfiguredFalse() {
  216. $this->config->expects($this->once())
  217. ->method('getSystemValue')
  218. ->with('memcache.local', null)
  219. ->will($this->returnValue(null));
  220. $this->assertFalse(
  221. self::invokePrivate(
  222. $this->checkSetupController,
  223. 'isMemcacheConfigured'
  224. )
  225. );
  226. }
  227. public function testIsMemcacheConfiguredTrue() {
  228. $this->config->expects($this->once())
  229. ->method('getSystemValue')
  230. ->with('memcache.local', null)
  231. ->will($this->returnValue('SomeProvider'));
  232. $this->assertTrue(
  233. self::invokePrivate(
  234. $this->checkSetupController,
  235. 'isMemcacheConfigured'
  236. )
  237. );
  238. }
  239. public function testIsPhpSupportedFalse() {
  240. $this->checkSetupController
  241. ->expects($this->once())
  242. ->method('isPhpOutdated')
  243. ->willReturn(true);
  244. $this->assertEquals(
  245. ['eol' => true, 'version' => PHP_VERSION],
  246. self::invokePrivate($this->checkSetupController, 'isPhpSupported')
  247. );
  248. }
  249. public function testIsPhpSupportedTrue() {
  250. $this->checkSetupController
  251. ->expects($this->exactly(2))
  252. ->method('isPhpOutdated')
  253. ->willReturn(false);
  254. $this->assertEquals(
  255. ['eol' => false, 'version' => PHP_VERSION],
  256. self::invokePrivate($this->checkSetupController, 'isPhpSupported')
  257. );
  258. $this->assertEquals(
  259. ['eol' => false, 'version' => PHP_VERSION],
  260. self::invokePrivate($this->checkSetupController, 'isPhpSupported')
  261. );
  262. }
  263. public function testForwardedForHeadersWorkingFalse() {
  264. $this->config->expects($this->once())
  265. ->method('getSystemValue')
  266. ->with('trusted_proxies', [])
  267. ->willReturn(['1.2.3.4']);
  268. $this->request->expects($this->once())
  269. ->method('getRemoteAddress')
  270. ->willReturn('1.2.3.4');
  271. $this->assertFalse(
  272. self::invokePrivate(
  273. $this->checkSetupController,
  274. 'forwardedForHeadersWorking'
  275. )
  276. );
  277. }
  278. public function testForwardedForHeadersWorkingTrue() {
  279. $this->config->expects($this->once())
  280. ->method('getSystemValue')
  281. ->with('trusted_proxies', [])
  282. ->willReturn(['1.2.3.4']);
  283. $this->request->expects($this->once())
  284. ->method('getRemoteAddress')
  285. ->willReturn('4.3.2.1');
  286. $this->assertTrue(
  287. self::invokePrivate(
  288. $this->checkSetupController,
  289. 'forwardedForHeadersWorking'
  290. )
  291. );
  292. }
  293. public function testCheck() {
  294. $this->config->expects($this->at(0))
  295. ->method('getAppValue')
  296. ->with('core', 'cronErrors')
  297. ->willReturn('');
  298. $this->config->expects($this->at(2))
  299. ->method('getSystemValue')
  300. ->with('memcache.local', null)
  301. ->will($this->returnValue('SomeProvider'));
  302. $this->config->expects($this->at(3))
  303. ->method('getSystemValue')
  304. ->with('has_internet_connection', true)
  305. ->will($this->returnValue(true));
  306. $this->config->expects($this->at(4))
  307. ->method('getSystemValue')
  308. ->with('appstoreenabled', true)
  309. ->will($this->returnValue(false));
  310. $this->request->expects($this->once())
  311. ->method('getRemoteAddress')
  312. ->willReturn('4.3.2.1');
  313. $client = $this->getMockBuilder('\OCP\Http\Client\IClient')
  314. ->disableOriginalConstructor()->getMock();
  315. $client->expects($this->at(0))
  316. ->method('get')
  317. ->with('http://www.nextcloud.com/', [])
  318. ->will($this->throwException(new \Exception()));
  319. $client->expects($this->at(1))
  320. ->method('get')
  321. ->with('http://www.startpage.com/', [])
  322. ->will($this->throwException(new \Exception()));
  323. $client->expects($this->at(2))
  324. ->method('get')
  325. ->with('http://www.eff.org/', [])
  326. ->will($this->throwException(new \Exception()));
  327. $client->expects($this->at(3))
  328. ->method('get')
  329. ->with('http://www.edri.org/', [])
  330. ->will($this->throwException(new \Exception()));
  331. $this->clientService->expects($this->exactly(4))
  332. ->method('newClient')
  333. ->will($this->returnValue($client));
  334. $this->urlGenerator->expects($this->at(0))
  335. ->method('linkToDocs')
  336. ->with('admin-performance')
  337. ->willReturn('http://docs.example.org/server/go.php?to=admin-performance');
  338. $this->urlGenerator->expects($this->at(1))
  339. ->method('linkToDocs')
  340. ->with('admin-security')
  341. ->willReturn('https://docs.example.org/server/8.1/admin_manual/configuration_server/hardening.html');
  342. $this->checkSetupController
  343. ->expects($this->once())
  344. ->method('isPhpOutdated')
  345. ->willReturn(true);
  346. $this->checkSetupController
  347. ->expects($this->once())
  348. ->method('isOpcacheProperlySetup')
  349. ->willReturn(false);
  350. $this->urlGenerator->expects($this->at(2))
  351. ->method('linkToDocs')
  352. ->with('admin-reverse-proxy')
  353. ->willReturn('reverse-proxy-doc-link');
  354. $this->urlGenerator->expects($this->at(3))
  355. ->method('linkToDocs')
  356. ->with('admin-code-integrity')
  357. ->willReturn('http://docs.example.org/server/go.php?to=admin-code-integrity');
  358. $this->urlGenerator->expects($this->at(4))
  359. ->method('linkToDocs')
  360. ->with('admin-php-opcache')
  361. ->willReturn('http://docs.example.org/server/go.php?to=admin-php-opcache');
  362. $this->urlGenerator->expects($this->at(5))
  363. ->method('linkToDocs')
  364. ->with('admin-db-conversion')
  365. ->willReturn('http://docs.example.org/server/go.php?to=admin-db-conversion');
  366. $this->urlGenerator->expects($this->at(6))
  367. ->method('getAbsoluteURL')
  368. ->with('index.php/settings/admin')
  369. ->willReturn('https://server/index.php/settings/admin');
  370. $this->checkSetupController
  371. ->method('hasFreeTypeSupport')
  372. ->willReturn(false);
  373. $this->checkSetupController
  374. ->method('hasMissingIndexes')
  375. ->willReturn([]);
  376. $this->checkSetupController
  377. ->method('getOutdatedCaches')
  378. ->willReturn([]);
  379. $this->checkSetupController
  380. ->method('isSqliteUsed')
  381. ->willReturn(false);
  382. $this->checkSetupController
  383. ->expects($this->once())
  384. ->method('isReadOnlyConfig')
  385. ->willReturn(false);
  386. $this->checkSetupController
  387. ->expects($this->once())
  388. ->method('hasValidTransactionIsolationLevel')
  389. ->willReturn(true);
  390. $this->checkSetupController
  391. ->expects($this->once())
  392. ->method('hasFileinfoInstalled')
  393. ->willReturn(true);
  394. $this->checkSetupController
  395. ->expects($this->once())
  396. ->method('hasOpcacheLoaded')
  397. ->willReturn(true);
  398. $this->checkSetupController
  399. ->expects($this->once())
  400. ->method('hasWorkingFileLocking')
  401. ->willReturn(true);
  402. $this->checkSetupController
  403. ->expects($this->once())
  404. ->method('getSuggestedOverwriteCliURL')
  405. ->willReturn('');
  406. $this->checkSetupController
  407. ->expects($this->once())
  408. ->method('getLastCronInfo')
  409. ->willReturn([
  410. 'diffInSeconds' => 123,
  411. 'relativeTime' => '2 hours ago',
  412. 'backgroundJobsUrl' => 'https://example.org',
  413. ]);
  414. $this->checkSetupController
  415. ->expects($this->once())
  416. ->method('isPhpMailerUsed')
  417. ->willReturn(false);
  418. $this->checker
  419. ->expects($this->once())
  420. ->method('hasPassedCheck')
  421. ->willReturn(true);
  422. $this->memoryInfo
  423. ->method('isMemoryLimitSufficient')
  424. ->willReturn(true);
  425. $this->checkSetupController
  426. ->expects($this->once())
  427. ->method('getAppDirsWithDifferentOwner')
  428. ->willReturn([]);
  429. $expected = new DataResponse(
  430. [
  431. 'isGetenvServerWorking' => true,
  432. 'isReadOnlyConfig' => false,
  433. 'hasValidTransactionIsolationLevel' => true,
  434. 'outdatedCaches' => [],
  435. 'hasFileinfoInstalled' => true,
  436. 'hasWorkingFileLocking' => true,
  437. 'suggestedOverwriteCliURL' => '',
  438. 'cronInfo' => [
  439. 'diffInSeconds' => 123,
  440. 'relativeTime' => '2 hours ago',
  441. 'backgroundJobsUrl' => 'https://example.org',
  442. ],
  443. 'cronErrors' => [],
  444. 'serverHasInternetConnection' => false,
  445. 'isMemcacheConfigured' => true,
  446. 'memcacheDocs' => 'http://docs.example.org/server/go.php?to=admin-performance',
  447. 'isUrandomAvailable' => self::invokePrivate($this->checkSetupController, 'isUrandomAvailable'),
  448. 'securityDocs' => 'https://docs.example.org/server/8.1/admin_manual/configuration_server/hardening.html',
  449. 'isUsedTlsLibOutdated' => '',
  450. 'phpSupported' => [
  451. 'eol' => true,
  452. 'version' => PHP_VERSION
  453. ],
  454. 'forwardedForHeadersWorking' => true,
  455. 'reverseProxyDocs' => 'reverse-proxy-doc-link',
  456. 'isCorrectMemcachedPHPModuleInstalled' => true,
  457. 'hasPassedCodeIntegrityCheck' => true,
  458. 'codeIntegrityCheckerDocumentation' => 'http://docs.example.org/server/go.php?to=admin-code-integrity',
  459. 'isOpcacheProperlySetup' => false,
  460. 'hasOpcacheLoaded' => true,
  461. 'phpOpcacheDocumentation' => 'http://docs.example.org/server/go.php?to=admin-php-opcache',
  462. 'isSettimelimitAvailable' => true,
  463. 'hasFreeTypeSupport' => false,
  464. 'isSqliteUsed' => false,
  465. 'databaseConversionDocumentation' => 'http://docs.example.org/server/go.php?to=admin-db-conversion',
  466. 'missingIndexes' => [],
  467. 'isPhpMailerUsed' => false,
  468. 'mailSettingsDocumentation' => 'https://server/index.php/settings/admin',
  469. 'isMemoryLimitSufficient' => true,
  470. 'appDirsWithDifferentOwner' => [],
  471. ]
  472. );
  473. $this->assertEquals($expected, $this->checkSetupController->check());
  474. }
  475. public function testGetCurlVersion() {
  476. $checkSetupController = $this->getMockBuilder('\OC\Settings\Controller\CheckSetupController')
  477. ->setConstructorArgs([
  478. 'settings',
  479. $this->request,
  480. $this->config,
  481. $this->clientService,
  482. $this->urlGenerator,
  483. $this->util,
  484. $this->l10n,
  485. $this->checker,
  486. $this->logger,
  487. $this->dispatcher,
  488. $this->db,
  489. $this->lockingProvider,
  490. $this->dateTimeFormatter,
  491. $this->memoryInfo,
  492. ])
  493. ->setMethods(null)->getMock();
  494. $this->assertArrayHasKey('ssl_version', $this->invokePrivate($checkSetupController, 'getCurlVersion'));
  495. }
  496. public function testIsUsedTlsLibOutdatedWithAnotherLibrary() {
  497. $this->config->expects($this->any())
  498. ->method('getSystemValue')
  499. ->will($this->returnValue(true));
  500. $this->checkSetupController
  501. ->expects($this->once())
  502. ->method('getCurlVersion')
  503. ->will($this->returnValue(['ssl_version' => 'SSLlib']));
  504. $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  505. }
  506. public function testIsUsedTlsLibOutdatedWithMisbehavingCurl() {
  507. $this->config->expects($this->any())
  508. ->method('getSystemValue')
  509. ->will($this->returnValue(true));
  510. $this->checkSetupController
  511. ->expects($this->once())
  512. ->method('getCurlVersion')
  513. ->will($this->returnValue([]));
  514. $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  515. }
  516. public function testIsUsedTlsLibOutdatedWithOlderOpenSsl() {
  517. $this->config->expects($this->any())
  518. ->method('getSystemValue')
  519. ->will($this->returnValue(true));
  520. $this->checkSetupController
  521. ->expects($this->once())
  522. ->method('getCurlVersion')
  523. ->will($this->returnValue(['ssl_version' => 'OpenSSL/1.0.1c']));
  524. $this->assertSame('cURL is using an outdated OpenSSL version (OpenSSL/1.0.1c). Please update your operating system or features such as installing and updating apps via the app store or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  525. }
  526. public function testIsUsedTlsLibOutdatedWithOlderOpenSslAndWithoutAppstore() {
  527. $this->config
  528. ->expects($this->at(0))
  529. ->method('getSystemValue')
  530. ->with('has_internet_connection', true)
  531. ->will($this->returnValue(true));
  532. $this->checkSetupController
  533. ->expects($this->once())
  534. ->method('getCurlVersion')
  535. ->will($this->returnValue(['ssl_version' => 'OpenSSL/1.0.1c']));
  536. $this->assertSame('cURL is using an outdated OpenSSL version (OpenSSL/1.0.1c). Please update your operating system or features such as Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  537. }
  538. public function testIsUsedTlsLibOutdatedWithOlderOpenSsl1() {
  539. $this->config->expects($this->any())
  540. ->method('getSystemValue')
  541. ->will($this->returnValue(true));
  542. $this->checkSetupController
  543. ->expects($this->once())
  544. ->method('getCurlVersion')
  545. ->will($this->returnValue(['ssl_version' => 'OpenSSL/1.0.2a']));
  546. $this->assertSame('cURL is using an outdated OpenSSL version (OpenSSL/1.0.2a). Please update your operating system or features such as installing and updating apps via the app store or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  547. }
  548. public function testIsUsedTlsLibOutdatedWithMatchingOpenSslVersion() {
  549. $this->config->expects($this->any())
  550. ->method('getSystemValue')
  551. ->will($this->returnValue(true));
  552. $this->checkSetupController
  553. ->expects($this->once())
  554. ->method('getCurlVersion')
  555. ->will($this->returnValue(['ssl_version' => 'OpenSSL/1.0.1d']));
  556. $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  557. }
  558. public function testIsUsedTlsLibOutdatedWithMatchingOpenSslVersion1() {
  559. $this->config->expects($this->any())
  560. ->method('getSystemValue')
  561. ->will($this->returnValue(true));
  562. $this->checkSetupController
  563. ->expects($this->once())
  564. ->method('getCurlVersion')
  565. ->will($this->returnValue(['ssl_version' => 'OpenSSL/1.0.2b']));
  566. $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  567. }
  568. /**
  569. * Setups a temp directory and some subdirectories.
  570. * Then calls the 'getAppDirsWithDifferentOwner' method.
  571. * The result is expected to be empty since
  572. * there are no directories with different owners than the current user.
  573. *
  574. * @return void
  575. */
  576. public function testAppDirectoryOwnersOk() {
  577. $tempDir = tempnam(sys_get_temp_dir(), 'apps') . 'dir';
  578. mkdir($tempDir);
  579. mkdir($tempDir . DIRECTORY_SEPARATOR . 'app1');
  580. mkdir($tempDir . DIRECTORY_SEPARATOR . 'app2');
  581. $this->dirsToRemove[] = $tempDir . DIRECTORY_SEPARATOR . 'app1';
  582. $this->dirsToRemove[] = $tempDir . DIRECTORY_SEPARATOR . 'app2';
  583. $this->dirsToRemove[] = $tempDir;
  584. OC::$APPSROOTS = [
  585. [
  586. 'path' => $tempDir,
  587. 'url' => '/apps',
  588. 'writable' => true,
  589. ],
  590. ];
  591. $this->assertSame(
  592. [],
  593. $this->invokePrivate($this->checkSetupController, 'getAppDirsWithDifferentOwner')
  594. );
  595. }
  596. /**
  597. * Calls the check for a none existing app root that is marked as not writable.
  598. * It's expected that no error happens since the check shouldn't apply.
  599. *
  600. * @return void
  601. */
  602. public function testAppDirectoryOwnersNotWritable() {
  603. $tempDir = tempnam(sys_get_temp_dir(), 'apps') . 'dir';
  604. OC::$APPSROOTS = [
  605. [
  606. 'path' => $tempDir,
  607. 'url' => '/apps',
  608. 'writable' => false,
  609. ],
  610. ];
  611. $this->assertSame(
  612. [],
  613. $this->invokePrivate($this->checkSetupController, 'getAppDirsWithDifferentOwner')
  614. );
  615. }
  616. public function testIsBuggyNss400() {
  617. $this->config->expects($this->any())
  618. ->method('getSystemValue')
  619. ->will($this->returnValue(true));
  620. $this->checkSetupController
  621. ->expects($this->once())
  622. ->method('getCurlVersion')
  623. ->will($this->returnValue(['ssl_version' => 'NSS/1.0.2b']));
  624. $client = $this->getMockBuilder('\OCP\Http\Client\IClient')
  625. ->disableOriginalConstructor()->getMock();
  626. $exception = $this->getMockBuilder('\GuzzleHttp\Exception\ClientException')
  627. ->disableOriginalConstructor()->getMock();
  628. $response = $this->getMockBuilder(ResponseInterface::class)
  629. ->disableOriginalConstructor()->getMock();
  630. $response->expects($this->once())
  631. ->method('getStatusCode')
  632. ->will($this->returnValue(400));
  633. $exception->expects($this->once())
  634. ->method('getResponse')
  635. ->will($this->returnValue($response));
  636. $client->expects($this->at(0))
  637. ->method('get')
  638. ->with('https://nextcloud.com/', [])
  639. ->will($this->throwException($exception));
  640. $this->clientService->expects($this->once())
  641. ->method('newClient')
  642. ->will($this->returnValue($client));
  643. $this->assertSame('cURL is using an outdated NSS version (NSS/1.0.2b). Please update your operating system or features such as installing and updating apps via the app store or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  644. }
  645. public function testIsBuggyNss200() {
  646. $this->config->expects($this->any())
  647. ->method('getSystemValue')
  648. ->will($this->returnValue(true));
  649. $this->checkSetupController
  650. ->expects($this->once())
  651. ->method('getCurlVersion')
  652. ->will($this->returnValue(['ssl_version' => 'NSS/1.0.2b']));
  653. $client = $this->getMockBuilder('\OCP\Http\Client\IClient')
  654. ->disableOriginalConstructor()->getMock();
  655. $exception = $this->getMockBuilder('\GuzzleHttp\Exception\ClientException')
  656. ->disableOriginalConstructor()->getMock();
  657. $response = $this->getMockBuilder(ResponseInterface::class)
  658. ->disableOriginalConstructor()->getMock();
  659. $response->expects($this->once())
  660. ->method('getStatusCode')
  661. ->will($this->returnValue(200));
  662. $exception->expects($this->once())
  663. ->method('getResponse')
  664. ->will($this->returnValue($response));
  665. $client->expects($this->at(0))
  666. ->method('get')
  667. ->with('https://nextcloud.com/', [])
  668. ->will($this->throwException($exception));
  669. $this->clientService->expects($this->once())
  670. ->method('newClient')
  671. ->will($this->returnValue($client));
  672. $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  673. }
  674. public function testIsUsedTlsLibOutdatedWithInternetDisabled() {
  675. $this->config
  676. ->expects($this->at(0))
  677. ->method('getSystemValue')
  678. ->with('has_internet_connection', true)
  679. ->will($this->returnValue(false));
  680. $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  681. }
  682. public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingEnabled() {
  683. $this->config
  684. ->expects($this->at(0))
  685. ->method('getSystemValue')
  686. ->with('has_internet_connection', true)
  687. ->will($this->returnValue(true));
  688. $this->config
  689. ->expects($this->at(1))
  690. ->method('getSystemValue')
  691. ->with('appstoreenabled', true)
  692. ->will($this->returnValue(false));
  693. $this->config
  694. ->expects($this->at(2))
  695. ->method('getAppValue')
  696. ->with('files_sharing', 'outgoing_server2server_share_enabled', 'yes')
  697. ->will($this->returnValue('no'));
  698. $this->config
  699. ->expects($this->at(3))
  700. ->method('getAppValue')
  701. ->with('files_sharing', 'incoming_server2server_share_enabled', 'yes')
  702. ->will($this->returnValue('yes'));
  703. $this->checkSetupController
  704. ->expects($this->once())
  705. ->method('getCurlVersion')
  706. ->will($this->returnValue([]));
  707. $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  708. }
  709. public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingDisabled() {
  710. $this->config
  711. ->expects($this->at(0))
  712. ->method('getSystemValue')
  713. ->with('has_internet_connection', true)
  714. ->will($this->returnValue(true));
  715. $this->config
  716. ->expects($this->at(1))
  717. ->method('getSystemValue')
  718. ->with('appstoreenabled', true)
  719. ->will($this->returnValue(false));
  720. $this->config
  721. ->expects($this->at(2))
  722. ->method('getAppValue')
  723. ->with('files_sharing', 'outgoing_server2server_share_enabled', 'yes')
  724. ->will($this->returnValue('no'));
  725. $this->config
  726. ->expects($this->at(3))
  727. ->method('getAppValue')
  728. ->with('files_sharing', 'incoming_server2server_share_enabled', 'yes')
  729. ->will($this->returnValue('no'));
  730. $this->checkSetupController
  731. ->expects($this->never())
  732. ->method('getCurlVersion')
  733. ->will($this->returnValue([]));
  734. $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
  735. }
  736. public function testRescanFailedIntegrityCheck() {
  737. $this->checker
  738. ->expects($this->once())
  739. ->method('runInstanceVerification');
  740. $this->urlGenerator
  741. ->expects($this->once())
  742. ->method('linkToRoute')
  743. ->with('settings.AdminSettings.index')
  744. ->will($this->returnValue('/admin'));
  745. $expected = new RedirectResponse('/admin');
  746. $this->assertEquals($expected, $this->checkSetupController->rescanFailedIntegrityCheck());
  747. }
  748. public function testGetFailedIntegrityCheckDisabled() {
  749. $this->checker
  750. ->expects($this->once())
  751. ->method('isCodeCheckEnforced')
  752. ->willReturn(false);
  753. $expected = new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.');
  754. $this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles());
  755. }
  756. public function testGetFailedIntegrityCheckFilesWithNoErrorsFound() {
  757. $this->checker
  758. ->expects($this->once())
  759. ->method('isCodeCheckEnforced')
  760. ->willReturn(true);
  761. $this->checker
  762. ->expects($this->once())
  763. ->method('getResults')
  764. ->will($this->returnValue([]));
  765. $expected = new DataDisplayResponse(
  766. 'No errors have been found.',
  767. Http::STATUS_OK,
  768. [
  769. 'Content-Type' => 'text/plain',
  770. ]
  771. );
  772. $this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles());
  773. }
  774. public function testGetFailedIntegrityCheckFilesWithSomeErrorsFound() {
  775. $this->checker
  776. ->expects($this->once())
  777. ->method('isCodeCheckEnforced')
  778. ->willReturn(true);
  779. $this->checker
  780. ->expects($this->once())
  781. ->method('getResults')
  782. ->will($this->returnValue(array ( 'core' => array ( 'EXTRA_FILE' => array('/testfile' => array()), 'INVALID_HASH' => array ( '/.idea/workspace.xml' => array ( 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ), '/lib/private/integritycheck/checker.php' => array ( 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ), '/settings/controller/checksetupcontroller.php' => array ( 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ), ), ), 'bookmarks' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'dav' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'encryption' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'external' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'federation' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_antivirus' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_drop' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_external' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_pdfviewer' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_sharing' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_trashbin' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_versions' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_videoviewer' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'firstrunwizard' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'gitsmart' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'logreader' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ), ), 'password_policy' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'provisioning_api' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'sketch' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'threatblock' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'two_factor_auth' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'user_ldap' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'user_shibboleth' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), )));
  783. $expected = new DataDisplayResponse(
  784. 'Technical information
  785. =====================
  786. The following list covers which files have failed the integrity check. Please read
  787. the previous linked documentation to learn more about the errors and how to fix
  788. them.
  789. Results
  790. =======
  791. - core
  792. - EXTRA_FILE
  793. - /testfile
  794. - INVALID_HASH
  795. - /.idea/workspace.xml
  796. - /lib/private/integritycheck/checker.php
  797. - /settings/controller/checksetupcontroller.php
  798. - bookmarks
  799. - EXCEPTION
  800. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  801. - Signature data not found.
  802. - dav
  803. - EXCEPTION
  804. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  805. - Signature data not found.
  806. - encryption
  807. - EXCEPTION
  808. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  809. - Signature data not found.
  810. - external
  811. - EXCEPTION
  812. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  813. - Signature data not found.
  814. - federation
  815. - EXCEPTION
  816. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  817. - Signature data not found.
  818. - files
  819. - EXCEPTION
  820. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  821. - Signature data not found.
  822. - files_antivirus
  823. - EXCEPTION
  824. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  825. - Signature data not found.
  826. - files_drop
  827. - EXCEPTION
  828. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  829. - Signature data not found.
  830. - files_external
  831. - EXCEPTION
  832. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  833. - Signature data not found.
  834. - files_pdfviewer
  835. - EXCEPTION
  836. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  837. - Signature data not found.
  838. - files_sharing
  839. - EXCEPTION
  840. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  841. - Signature data not found.
  842. - files_trashbin
  843. - EXCEPTION
  844. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  845. - Signature data not found.
  846. - files_versions
  847. - EXCEPTION
  848. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  849. - Signature data not found.
  850. - files_videoviewer
  851. - EXCEPTION
  852. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  853. - Signature data not found.
  854. - firstrunwizard
  855. - EXCEPTION
  856. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  857. - Signature data not found.
  858. - gitsmart
  859. - EXCEPTION
  860. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  861. - Signature data not found.
  862. - logreader
  863. - EXCEPTION
  864. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  865. - Signature could not get verified.
  866. - password_policy
  867. - EXCEPTION
  868. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  869. - Signature data not found.
  870. - provisioning_api
  871. - EXCEPTION
  872. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  873. - Signature data not found.
  874. - sketch
  875. - EXCEPTION
  876. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  877. - Signature data not found.
  878. - threatblock
  879. - EXCEPTION
  880. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  881. - Signature data not found.
  882. - two_factor_auth
  883. - EXCEPTION
  884. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  885. - Signature data not found.
  886. - user_ldap
  887. - EXCEPTION
  888. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  889. - Signature data not found.
  890. - user_shibboleth
  891. - EXCEPTION
  892. - OC\IntegrityCheck\Exceptions\InvalidSignatureException
  893. - Signature data not found.
  894. Raw output
  895. ==========
  896. Array
  897. (
  898. [core] => Array
  899. (
  900. [EXTRA_FILE] => Array
  901. (
  902. [/testfile] => Array
  903. (
  904. )
  905. )
  906. [INVALID_HASH] => Array
  907. (
  908. [/.idea/workspace.xml] => Array
  909. (
  910. [expected] => f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216
  911. [current] => ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094
  912. )
  913. [/lib/private/integritycheck/checker.php] => Array
  914. (
  915. [expected] => c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea
  916. [current] => 88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585
  917. )
  918. [/settings/controller/checksetupcontroller.php] => Array
  919. (
  920. [expected] => 3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4
  921. [current] => 09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a
  922. )
  923. )
  924. )
  925. [bookmarks] => Array
  926. (
  927. [EXCEPTION] => Array
  928. (
  929. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  930. [message] => Signature data not found.
  931. )
  932. )
  933. [dav] => Array
  934. (
  935. [EXCEPTION] => Array
  936. (
  937. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  938. [message] => Signature data not found.
  939. )
  940. )
  941. [encryption] => Array
  942. (
  943. [EXCEPTION] => Array
  944. (
  945. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  946. [message] => Signature data not found.
  947. )
  948. )
  949. [external] => Array
  950. (
  951. [EXCEPTION] => Array
  952. (
  953. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  954. [message] => Signature data not found.
  955. )
  956. )
  957. [federation] => Array
  958. (
  959. [EXCEPTION] => Array
  960. (
  961. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  962. [message] => Signature data not found.
  963. )
  964. )
  965. [files] => Array
  966. (
  967. [EXCEPTION] => Array
  968. (
  969. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  970. [message] => Signature data not found.
  971. )
  972. )
  973. [files_antivirus] => Array
  974. (
  975. [EXCEPTION] => Array
  976. (
  977. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  978. [message] => Signature data not found.
  979. )
  980. )
  981. [files_drop] => Array
  982. (
  983. [EXCEPTION] => Array
  984. (
  985. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  986. [message] => Signature data not found.
  987. )
  988. )
  989. [files_external] => Array
  990. (
  991. [EXCEPTION] => Array
  992. (
  993. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  994. [message] => Signature data not found.
  995. )
  996. )
  997. [files_pdfviewer] => Array
  998. (
  999. [EXCEPTION] => Array
  1000. (
  1001. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1002. [message] => Signature data not found.
  1003. )
  1004. )
  1005. [files_sharing] => Array
  1006. (
  1007. [EXCEPTION] => Array
  1008. (
  1009. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1010. [message] => Signature data not found.
  1011. )
  1012. )
  1013. [files_trashbin] => Array
  1014. (
  1015. [EXCEPTION] => Array
  1016. (
  1017. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1018. [message] => Signature data not found.
  1019. )
  1020. )
  1021. [files_versions] => Array
  1022. (
  1023. [EXCEPTION] => Array
  1024. (
  1025. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1026. [message] => Signature data not found.
  1027. )
  1028. )
  1029. [files_videoviewer] => Array
  1030. (
  1031. [EXCEPTION] => Array
  1032. (
  1033. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1034. [message] => Signature data not found.
  1035. )
  1036. )
  1037. [firstrunwizard] => Array
  1038. (
  1039. [EXCEPTION] => Array
  1040. (
  1041. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1042. [message] => Signature data not found.
  1043. )
  1044. )
  1045. [gitsmart] => Array
  1046. (
  1047. [EXCEPTION] => Array
  1048. (
  1049. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1050. [message] => Signature data not found.
  1051. )
  1052. )
  1053. [logreader] => Array
  1054. (
  1055. [EXCEPTION] => Array
  1056. (
  1057. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1058. [message] => Signature could not get verified.
  1059. )
  1060. )
  1061. [password_policy] => Array
  1062. (
  1063. [EXCEPTION] => Array
  1064. (
  1065. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1066. [message] => Signature data not found.
  1067. )
  1068. )
  1069. [provisioning_api] => Array
  1070. (
  1071. [EXCEPTION] => Array
  1072. (
  1073. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1074. [message] => Signature data not found.
  1075. )
  1076. )
  1077. [sketch] => Array
  1078. (
  1079. [EXCEPTION] => Array
  1080. (
  1081. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1082. [message] => Signature data not found.
  1083. )
  1084. )
  1085. [threatblock] => Array
  1086. (
  1087. [EXCEPTION] => Array
  1088. (
  1089. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1090. [message] => Signature data not found.
  1091. )
  1092. )
  1093. [two_factor_auth] => Array
  1094. (
  1095. [EXCEPTION] => Array
  1096. (
  1097. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1098. [message] => Signature data not found.
  1099. )
  1100. )
  1101. [user_ldap] => Array
  1102. (
  1103. [EXCEPTION] => Array
  1104. (
  1105. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1106. [message] => Signature data not found.
  1107. )
  1108. )
  1109. [user_shibboleth] => Array
  1110. (
  1111. [EXCEPTION] => Array
  1112. (
  1113. [class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
  1114. [message] => Signature data not found.
  1115. )
  1116. )
  1117. )
  1118. ',
  1119. Http::STATUS_OK,
  1120. [
  1121. 'Content-Type' => 'text/plain',
  1122. ]
  1123. );
  1124. $this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles());
  1125. }
  1126. }