summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-02-15 00:40:36 -0600
committerMorris Jobke <hey@morrisjobke.de>2017-02-22 23:45:48 -0600
commitcee8853658703358a8e564c414807c632ee0d5ea (patch)
treeb7ecd1915099914b4d2f8ccec9c3fe16e7008107 /core/js/tests
parent41276f720b838681d571c40da937e0b143c9fdf6 (diff)
downloadnextcloud-server-cee8853658703358a8e564c414807c632ee0d5ea.tar.gz
nextcloud-server-cee8853658703358a8e564c414807c632ee0d5ea.zip
Show info in admin settings about PHP opcache if disabled
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/js/tests')
-rw-r--r--core/js/tests/specs/setupchecksSpec.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index faa8a2bf277..1ee16a7af81 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -155,6 +155,7 @@ describe('OC.SetupChecks tests', function() {
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: true,
})
);
@@ -186,6 +187,7 @@ describe('OC.SetupChecks tests', function() {
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: true,
})
);
@@ -218,6 +220,7 @@ describe('OC.SetupChecks tests', function() {
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: true,
})
);
@@ -248,6 +251,7 @@ describe('OC.SetupChecks tests', function() {
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: true,
})
);
@@ -276,6 +280,7 @@ describe('OC.SetupChecks tests', function() {
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: false,
hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: true,
})
);
@@ -304,6 +309,7 @@ describe('OC.SetupChecks tests', function() {
reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html',
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: true,
})
);
@@ -353,6 +359,7 @@ describe('OC.SetupChecks tests', function() {
phpSupported: {eol: true, version: '5.4.0'},
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: true,
})
);
@@ -364,6 +371,36 @@ describe('OC.SetupChecks tests', function() {
done();
});
});
+
+ it('should return an info if server has no proper opcache', function(done) {
+ var async = OC.SetupChecks.checkSetup();
+
+ suite.server.requests[0].respond(
+ 200,
+ {
+ 'Content-Type': 'application/json'
+ },
+ JSON.stringify({
+ isUrandomAvailable: true,
+ securityDocs: 'https://docs.owncloud.org/myDocs.html',
+ serverHasInternetConnection: true,
+ isMemcacheConfigured: true,
+ forwardedForHeadersWorking: true,
+ isCorrectMemcachedPHPModuleInstalled: true,
+ hasPassedCodeIntegrityCheck: true,
+ isOpcacheProperlySetup: false,
+ phpOpcacheDocumentation: 'https://example.org/link/to/doc',
+ })
+ );
+
+ async.done(function( data, s, x ){
+ expect(data).toEqual([{
+ msg: 'The PHP Opcache is not properly configured. <a target="_blank" rel="noreferrer" href="https://example.org/link/to/doc">For better performance we recommend ↗</a> to use following settings in the <code>php.ini</code>:' + "<pre><code>opcache.enable=On\nopcache.enable_cli=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1</code></pre>",
+ type: OC.SetupChecks.MESSAGE_TYPE_INFO
+ }]);
+ done();
+ });
+ });
});
describe('checkGeneric', function() {