From 6e45fd49f352448bf9825018109ce73336ca5de1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 21 Aug 2020 16:21:36 +0200 Subject: [PATCH] Statically set "nickname" for user-field in API tests, because there is no authentication action. --- tests/include/ApiTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/include/ApiTest.php b/tests/include/ApiTest.php index 8e2088cc93..ceeaac6f6f 100644 --- a/tests/include/ApiTest.php +++ b/tests/include/ApiTest.php @@ -2869,6 +2869,7 @@ class ApiTest extends FixtureTest */ public function testApiDirectMessagesNewWithScreenName() { + $this->app->user = ['nickname' => $this->selfUser['nick']]; $_POST['text'] = 'message_text'; $_POST['screen_name'] = $this->friendUser['nick']; $result = api_direct_messages_new('json'); @@ -2884,6 +2885,7 @@ class ApiTest extends FixtureTest */ public function testApiDirectMessagesNewWithTitle() { + $this->app->user = ['nickname' => $this->selfUser['nick']]; $_POST['text'] = 'message_text'; $_POST['screen_name'] = $this->friendUser['nick']; $_REQUEST['title'] = 'message_title'; @@ -2901,6 +2903,7 @@ class ApiTest extends FixtureTest */ public function testApiDirectMessagesNewWithRss() { + $this->app->user = ['nickname' => $this->selfUser['nick']]; $_POST['text'] = 'message_text'; $_POST['screen_name'] = $this->friendUser['nick']; $result = api_direct_messages_new('rss');