@@ -171,6 +171,7 @@ describe('OC.SetupChecks tests', function() {
171171 cronInfo : {
172172 diffInSeconds : 0
173173 } ,
174+ isMemoryLimitSufficient : true ,
174175 appDirsWithDifferentOwner : [ ]
175176 } )
176177 ) ;
@@ -219,6 +220,7 @@ describe('OC.SetupChecks tests', function() {
219220 cronInfo : {
220221 diffInSeconds : 0
221222 } ,
223+ isMemoryLimitSufficient : true ,
222224 appDirsWithDifferentOwner : [ ]
223225 } )
224226 ) ;
@@ -268,6 +270,7 @@ describe('OC.SetupChecks tests', function() {
268270 cronInfo : {
269271 diffInSeconds : 0
270272 } ,
273+ isMemoryLimitSufficient : true ,
271274 appDirsWithDifferentOwner : [ ]
272275 } )
273276 ) ;
@@ -315,6 +318,7 @@ describe('OC.SetupChecks tests', function() {
315318 cronInfo : {
316319 diffInSeconds : 0
317320 } ,
321+ isMemoryLimitSufficient : true ,
318322 appDirsWithDifferentOwner : [ ]
319323 } )
320324 ) ;
@@ -360,6 +364,7 @@ describe('OC.SetupChecks tests', function() {
360364 cronInfo : {
361365 diffInSeconds : 0
362366 } ,
367+ isMemoryLimitSufficient : true ,
363368 appDirsWithDifferentOwner : [ ]
364369 } )
365370 ) ;
@@ -405,6 +410,7 @@ describe('OC.SetupChecks tests', function() {
405410 cronInfo : {
406411 diffInSeconds : 0
407412 } ,
413+ isMemoryLimitSufficient : true ,
408414 appDirsWithDifferentOwner : [
409415 '/some/path'
410416 ]
@@ -452,6 +458,7 @@ describe('OC.SetupChecks tests', function() {
452458 cronInfo : {
453459 diffInSeconds : 0
454460 } ,
461+ isMemoryLimitSufficient : true ,
455462 appDirsWithDifferentOwner : [ ]
456463 } )
457464 ) ;
@@ -497,6 +504,7 @@ describe('OC.SetupChecks tests', function() {
497504 cronInfo : {
498505 diffInSeconds : 0
499506 } ,
507+ isMemoryLimitSufficient : true ,
500508 appDirsWithDifferentOwner : [ ]
501509 } )
502510 ) ;
@@ -510,6 +518,52 @@ describe('OC.SetupChecks tests', function() {
510518 } ) ;
511519 } ) ;
512520
521+ it ( 'should return a warning if the memory limit is below the recommended value' , function ( done ) {
522+ var async = OC . SetupChecks . checkSetup ( ) ;
523+
524+ suite . server . requests [ 0 ] . respond (
525+ 200 ,
526+ {
527+ 'Content-Type' : 'application/json' ,
528+ } ,
529+ JSON . stringify ( {
530+ hasFileinfoInstalled : true ,
531+ isGetenvServerWorking : true ,
532+ isReadOnlyConfig : false ,
533+ hasWorkingFileLocking : true ,
534+ hasValidTransactionIsolationLevel : true ,
535+ suggestedOverwriteCliURL : '' ,
536+ isUrandomAvailable : true ,
537+ serverHasInternetConnection : true ,
538+ isMemcacheConfigured : true ,
539+ forwardedForHeadersWorking : true ,
540+ reverseProxyDocs : 'https://docs.owncloud.org/foo/bar.html' ,
541+ isCorrectMemcachedPHPModuleInstalled : true ,
542+ hasPassedCodeIntegrityCheck : true ,
543+ isOpcacheProperlySetup : true ,
544+ hasOpcacheLoaded : true ,
545+ isSettimelimitAvailable : true ,
546+ hasFreeTypeSupport : true ,
547+ missingIndexes : [ ] ,
548+ outdatedCaches : [ ] ,
549+ cronErrors : [ ] ,
550+ cronInfo : {
551+ diffInSeconds : 0
552+ } ,
553+ appDirsWithDifferentOwner : [ ] ,
554+ isMemoryLimitSufficient : false
555+ } )
556+ ) ;
557+
558+ async . done ( function ( data , s , x ) {
559+ expect ( data ) . toEqual ( [ {
560+ msg : 'The PHP memory limit is below the recommended value of 512MB.' ,
561+ type : OC . SetupChecks . MESSAGE_TYPE_WARNING
562+ } ] ) ;
563+ done ( ) ;
564+ } ) ;
565+ } ) ;
566+
513567 it ( 'should return an error if the response has no statuscode 200' , function ( done ) {
514568 var async = OC . SetupChecks . checkSetup ( ) ;
515569
@@ -563,6 +617,7 @@ describe('OC.SetupChecks tests', function() {
563617 cronInfo : {
564618 diffInSeconds : 0
565619 } ,
620+ isMemoryLimitSufficient : true ,
566621 appDirsWithDifferentOwner : [ ]
567622 } )
568623 ) ;
@@ -609,6 +664,7 @@ describe('OC.SetupChecks tests', function() {
609664 cronInfo : {
610665 diffInSeconds : 0
611666 } ,
667+ isMemoryLimitSufficient : true ,
612668 appDirsWithDifferentOwner : [ ]
613669 } )
614670 ) ;
@@ -655,6 +711,7 @@ describe('OC.SetupChecks tests', function() {
655711 cronInfo : {
656712 diffInSeconds : 0
657713 } ,
714+ isMemoryLimitSufficient : true ,
658715 appDirsWithDifferentOwner : [ ]
659716 } )
660717 ) ;
@@ -701,6 +758,7 @@ describe('OC.SetupChecks tests', function() {
701758 cronInfo : {
702759 diffInSeconds : 0
703760 } ,
761+ isMemoryLimitSufficient : true ,
704762 appDirsWithDifferentOwner : [ ]
705763 } )
706764 ) ;
0 commit comments