Fixing tests

This commit is contained in:
Michael 2021-11-26 10:48:38 +00:00
parent ce161386e7
commit f5a3f8039d
2 changed files with 3 additions and 3 deletions

View File

@ -1387,7 +1387,7 @@ function api_direct_messages_new($type)
$sender = DI::twitterUser()->createFromUserId($uid, true)->toArray(); $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)) { if (empty($cid)) {
throw new NotFoundException('Recipient not found'); throw new NotFoundException('Recipient not found');
} }

View File

@ -2499,8 +2499,8 @@ class ApiTest extends FixtureTest
*/ */
public function testApiDirectMessagesNewWithUserId() public function testApiDirectMessagesNewWithUserId()
{ {
$_POST['text'] = 'message_text'; $_POST['text'] = 'message_text';
$_POST['user_id'] = $this->otherUser['id']; $_REQUEST['user_id'] = $this->otherUser['id'];
$result = api_direct_messages_new('json'); $result = api_direct_messages_new('json');
self::assertEquals(['direct_message' => ['error' => -1]], $result); self::assertEquals(['direct_message' => ['error' => -1]], $result);
} }