aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Controller/AvatarControllerTest.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2021-10-25 16:16:55 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2021-11-23 09:29:01 +0100
commit8b271b8a123f0f0cbf3a3d81cf9cf3f99a2e642e (patch)
tree2a9aab48581704506965f8ff7628d25e13fa0042 /tests/Core/Controller/AvatarControllerTest.php
parentcd72045433eafc8f73a620239dc5afa6a0a6d84d (diff)
downloadnextcloud-server-8b271b8a123f0f0cbf3a3d81cf9cf3f99a2e642e.tar.gz
nextcloud-server-8b271b8a123f0f0cbf3a3d81cf9cf3f99a2e642e.zip
Fix tests and avoid PHP errors in them
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests/Core/Controller/AvatarControllerTest.php')
-rw-r--r--tests/Core/Controller/AvatarControllerTest.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php
index d6c4ea6217c..35d89c24a45 100644
--- a/tests/Core/Controller/AvatarControllerTest.php
+++ b/tests/Core/Controller/AvatarControllerTest.php
@@ -119,6 +119,8 @@ class AvatarControllerTest extends \Test\TestCase {
$this->avatarFile->method('getContent')->willReturn('image data');
$this->avatarFile->method('getMimeType')->willReturn('image type');
$this->avatarFile->method('getEtag')->willReturn('my etag');
+ $this->avatarFile->method('getName')->willReturn('my name');
+ $this->avatarFile->method('getMTime')->willReturn(42);
}
protected function tearDown(): void {
@@ -290,7 +292,7 @@ class AvatarControllerTest extends \Test\TestCase {
*/
public function testPostAvatarFile() {
//Create temp file
- $fileName = tempnam(null, "avatarTest");
+ $fileName = tempnam('', "avatarTest");
$copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.jpg', $fileName);
$this->assertTrue($copyRes);
@@ -328,7 +330,7 @@ class AvatarControllerTest extends \Test\TestCase {
*/
public function testPostAvatarFileGif() {
//Create temp file
- $fileName = tempnam(null, "avatarTest");
+ $fileName = tempnam('', "avatarTest");
$copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.gif', $fileName);
$this->assertTrue($copyRes);