]> git.mxchange.org Git - friendica.git/blob - tests/src/Module/Api/Twitter/Account/UpdateProfileTest.php
Fix tests
[friendica.git] / tests / src / Module / Api / Twitter / Account / UpdateProfileTest.php
1 <?php
2
3 namespace Friendica\Test\src\Module\Api\Twitter\Account;
4
5 use Friendica\App\Router;
6 use Friendica\DI;
7 use Friendica\Module\Api\Twitter\Account\UpdateProfile;
8 use Friendica\Test\src\Module\Api\ApiTest;
9
10 class UpdateProfileTest extends ApiTest
11 {
12         /**
13          * Test the api_account_update_profile() function.
14          */
15         public function testApiAccountUpdateProfile()
16         {
17                 $updateProfile = new UpdateProfile(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST], ['extension' => 'json']);
18                 $response      = $updateProfile->run(['name' => 'new_name', 'description' => 'new_description']);
19
20                 $body = (string)$response->getBody();
21
22                 self::assertJson($body);
23
24                 $json = json_decode($body);
25
26                 self::assertEquals('new_name', $json->name);
27                 self::assertEquals('new_description', $json->description);
28         }
29 }