From f5a3f8039df2031397cf236ab54b37b991c028be Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 26 Nov 2021 10:48:38 +0000 Subject: [PATCH] Fixing tests --- include/api.php | 2 +- tests/legacy/ApiTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/api.php b/include/api.php index 929102de3a..a78ed078ec 100644 --- a/include/api.php +++ b/include/api.php @@ -1387,7 +1387,7 @@ function api_direct_messages_new($type) $sender = DI::twitterUser()->createFromUserId($uid, true)->toArray(); - $cid = BaseApi::getContactIDForSearchterm($_REQUEST['screen_name'] ?? '', $_REQUEST['profileurl'] ?? '', $_REQUEST['user_id'] ?? 0, $uid); + $cid = BaseApi::getContactIDForSearchterm($_REQUEST['screen_name'] ?? '', $_REQUEST['profileurl'] ?? '', $_REQUEST['user_id'] ?? 0, 0); if (empty($cid)) { throw new NotFoundException('Recipient not found'); } diff --git a/tests/legacy/ApiTest.php b/tests/legacy/ApiTest.php index 474ff68f25..081b042818 100644 --- a/tests/legacy/ApiTest.php +++ b/tests/legacy/ApiTest.php @@ -2499,8 +2499,8 @@ class ApiTest extends FixtureTest */ public function testApiDirectMessagesNewWithUserId() { - $_POST['text'] = 'message_text'; - $_POST['user_id'] = $this->otherUser['id']; + $_POST['text'] = 'message_text'; + $_REQUEST['user_id'] = $this->otherUser['id']; $result = api_direct_messages_new('json'); self::assertEquals(['direct_message' => ['error' => -1]], $result); }