From e8e4566aaa599333a3bc118c7ffeb4eef8020cb9 Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Mon, 18 Dec 2017 13:01:08 +0800 Subject: [PATCH] MDL-52100 filelib: Update to unit tests for maxbytes. --- lib/tests/filelib_test.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tests/filelib_test.php b/lib/tests/filelib_test.php index b6109d98164..b6a1b7efb05 100644 --- a/lib/tests/filelib_test.php +++ b/lib/tests/filelib_test.php @@ -1046,7 +1046,6 @@ EOF; public static function create_draft_file($filedata = array()) { global $USER; - self::setAdminUser(); $fs = get_file_storage(); $filerecord = array( @@ -1208,7 +1207,9 @@ EOF; global $USER; $this->resetAfterTest(true); - $this->setAdminUser(); + // The admin has no restriction for max file uploads, so use a normal user. + $user = $this->getDataGenerator()->create_user(); + $this->setUser($user); $fs = get_file_storage(); $file = self::create_draft_file();