3 namespace Friendica\Test\src\Module\Api\Twitter\Account;
5 use Friendica\App\Router;
7 use Friendica\Module\Api\Twitter\Account\UpdateProfile;
8 use Friendica\Test\src\Module\Api\ApiTest;
10 class UpdateProfileTest extends ApiTest
13 * Test the api_account_update_profile() function.
15 public function testApiAccountUpdateProfile()
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']);
20 $body = (string)$response->getBody();
22 self::assertJson($body);
24 $json = json_decode($body);
26 self::assertEquals(42, $json->id);
27 self::assertEquals('DFRN', $json->location);
28 self::assertEquals('selfcontact', $json->screen_name);
29 self::assertEquals('new_name', $json->name);
30 self::assertEquals('new_description', $json->description);