We have to mock the is_uploaded_file in the OC\Core\Controller namespace

This commit is contained in:
Roeland Jago Douma 2016-08-15 20:08:20 +02:00
parent 09f4ce4389
commit 87ac72d004
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 10 additions and 8 deletions

View File

@ -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
*