From f1bd4db49559070febf67f99c3a568836968c0ca Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Thu, 19 Aug 2021 13:46:04 +0100 Subject: [PATCH] [TESTS] Fix Common test --- tests/Util/CommonTest.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/Util/CommonTest.php b/tests/Util/CommonTest.php index ad2df25f2c..a1512436a8 100644 --- a/tests/Util/CommonTest.php +++ b/tests/Util/CommonTest.php @@ -159,14 +159,16 @@ class CommonTest extends GNUsocialTestCase public function testGetPreferredPhpUploadLimit() { - $post_max_size = ini_set('post_max_size', 1); - $upload_max_filesize = ini_set('upload_max_filesize', 1); - $memory_limit = ini_set('memory_limit', 1); + // These limits can only be set in the config files + // $post_max_size = ini_set('post_max_size', Common::sizeStrToInt('6M')); + // $upload_max_filesize = ini_set('upload_max_filesize', Common::sizeStrToInt('1M')); + $memory_limit = ini_set('memory_limit', Common::sizeStrToInt('128M')); - static::assertSame(1, Common::getPreferredPhpUploadLimit()); + // 2M is the default for upload_max_filesize, the lowest considered + static::assertSame(Common::sizeStrToInt('2M'), Common::getPreferredPhpUploadLimit()); - ini_set('post_max_size', $post_max_size); - ini_set('upload_max_filesize', $upload_max_filesize); + // ini_set('post_max_size', $post_max_size); + // ini_set('upload_max_filesize', $upload_max_filesize); ini_set('memory_limit', $memory_limit); }