From 8b271b8a123f0f0cbf3a3d81cf9cf3f99a2e642e Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Mon, 25 Oct 2021 16:16:55 +0200 Subject: Fix tests and avoid PHP errors in them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/Core/Controller/AvatarControllerTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/Core/Controller/AvatarControllerTest.php') 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); -- cgit v1.2.3