From 87ac72d004b318c4b90c93f303575ba19f5b9cd9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 15 Aug 2016 20:08:20 +0200 Subject: [PATCH] We have to mock the is_uploaded_file in the OC\Core\Controller namespace --- tests/Core/Controller/AvatarControllerTest.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index 4a7b7f2178..d45d061823 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -19,6 +19,16 @@ * */ +namespace OC\Core\Controller; + +/** + * Overwrite is_uploaded_file in the OC\Core\Controller namespace to allow + * proper unit testing of the postAvatar call. + */ +function is_uploaded_file($filename) { + return file_exists($filename); +} + namespace Tests\Core\Controller; use OC\Core\Application; @@ -31,14 +41,6 @@ use OCP\IAvatar; use Punic\Exception; use Test\Traits\UserTrait; -/** - * Overwrite is_uploaded_file in this namespace to allow proper unit testing of - * the postAvatar call. - */ -function is_uploaded_file($filename) { - return file_exists($filename); -} - /** * Class AvatarControllerTest *