]> git.mxchange.org Git - friendica.git/blob - tests/src/Module/Api/Twitter/Users/LookupTest.php
Reenable Twitter/Search test
[friendica.git] / tests / src / Module / Api / Twitter / Users / LookupTest.php
1 <?php
2
3 namespace Friendica\Test\src\Module\Api\Twitter\Users;
4
5 use Friendica\App\Router;
6 use Friendica\DI;
7 use Friendica\Module\Api\Twitter\Users\Lookup;
8 use Friendica\Network\HTTPException\NotFoundException;
9 use Friendica\Test\src\Module\Api\ApiTest;
10
11 class LookupTest extends ApiTest
12 {
13         /**
14          * Test the api_users_lookup() function.
15          *
16          * @return void
17          */
18         public function testApiUsersLookup()
19         {
20                 $this->expectException(NotFoundException::class);
21
22                 $lookup = new Lookup(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]);
23                 $lookup->run();
24         }
25
26         /**
27          * Test the api_users_lookup() function with an user ID.
28          *
29          * @return void
30          */
31         public function testApiUsersLookupWithUserId()
32         {
33                 $lookup = new Lookup(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]);
34                 $respone = $lookup->run(['user_id' => static::OTHER_USER['id']]);
35
36                 $json = $this->toJson($respone);
37
38                 self::assertOtherUser($json[0]);
39         }
40 }