diff options
Diffstat (limited to 'core/js/tests')
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 30c2ad9c5f0..4c0545b7b4f 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -171,6 +171,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -219,6 +220,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -268,6 +270,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -315,6 +318,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -360,6 +364,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -405,6 +410,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [ '/some/path' ] @@ -452,6 +458,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -497,6 +504,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -510,6 +518,52 @@ describe('OC.SetupChecks tests', function() { }); }); + it('should return a warning if the memory limit is below the recommended value', function(done) { + var async = OC.SetupChecks.checkSetup(); + + suite.server.requests[0].respond( + 200, + { + 'Content-Type': 'application/json', + }, + JSON.stringify({ + hasFileinfoInstalled: true, + isGetenvServerWorking: true, + isReadOnlyConfig: false, + hasWorkingFileLocking: true, + hasValidTransactionIsolationLevel: true, + suggestedOverwriteCliURL: '', + isUrandomAvailable: true, + serverHasInternetConnection: true, + isMemcacheConfigured: true, + forwardedForHeadersWorking: true, + reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html', + isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, + isOpcacheProperlySetup: true, + hasOpcacheLoaded: true, + isSettimelimitAvailable: true, + hasFreeTypeSupport: true, + missingIndexes: [], + outdatedCaches: [], + cronErrors: [], + cronInfo: { + diffInSeconds: 0 + }, + appDirsWithDifferentOwner: [], + isMemoryLimitSufficient: false + }) + ); + + async.done(function( data, s, x ){ + expect(data).toEqual([{ + msg: 'The PHP memory limit is below the recommended value of 512MB.', + type: OC.SetupChecks.MESSAGE_TYPE_WARNING + }]); + done(); + }); + }); + it('should return an error if the response has no statuscode 200', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -563,6 +617,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -609,6 +664,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -655,6 +711,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); @@ -701,6 +758,7 @@ describe('OC.SetupChecks tests', function() { cronInfo: { diffInSeconds: 0 }, + isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [] }) ); |