api_get_user isn't used without parameters anymore

This commit is contained in:
Michael 2021-11-18 07:06:08 +00:00
parent 0c26ae31f6
commit 98b68b47f0

View File

@ -645,8 +645,8 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUser() public function testApiGetUser()
{ {
$user = api_get_user(); // $user = api_get_user();
self::assertSelfUser($user); // self::assertSelfUser($user);
// self::assertEquals('708fa0', $user['profile_sidebar_fill_color']); // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
// self::assertEquals('6fdbe8', $user['profile_link_color']); // self::assertEquals('6fdbe8', $user['profile_link_color']);
// self::assertEquals('ededed', $user['profile_background_color']); // self::assertEquals('ededed', $user['profile_background_color']);
@ -659,10 +659,10 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithFrioSchema() public function testApiGetUserWithFrioSchema()
{ {
$pConfig = $this->dice->create(IManagePersonalConfigValues::class); // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
$pConfig->set($this->selfUser['id'], 'frio', 'schema', 'red'); // $pConfig->set($this->selfUser['id'], 'frio', 'schema', 'red');
$user = api_get_user(); // $user = api_get_user();
self::assertSelfUser($user); // self::assertSelfUser($user);
// self::assertEquals('708fa0', $user['profile_sidebar_fill_color']); // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
// self::assertEquals('6fdbe8', $user['profile_link_color']); // self::assertEquals('6fdbe8', $user['profile_link_color']);
// self::assertEquals('ededed', $user['profile_background_color']); // self::assertEquals('ededed', $user['profile_background_color']);
@ -675,10 +675,10 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithEmptyFrioSchema() public function testApiGetUserWithEmptyFrioSchema()
{ {
$pConfig = $this->dice->create(IManagePersonalConfigValues::class); // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
$pConfig->set($this->selfUser['id'], 'frio', 'schema', '---'); // $pConfig->set($this->selfUser['id'], 'frio', 'schema', '---');
$user = api_get_user(); // $user = api_get_user();
self::assertSelfUser($user); // self::assertSelfUser($user);
// self::assertEquals('708fa0', $user['profile_sidebar_fill_color']); // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
// self::assertEquals('6fdbe8', $user['profile_link_color']); // self::assertEquals('6fdbe8', $user['profile_link_color']);
// self::assertEquals('ededed', $user['profile_background_color']); // self::assertEquals('ededed', $user['profile_background_color']);
@ -691,13 +691,13 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithCustomFrioSchema() public function testApiGetUserWithCustomFrioSchema()
{ {
$pConfig = $this->dice->create(IManagePersonalConfigValues::class); // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
$pConfig->set($this->selfUser['id'], 'frio', 'schema', '---'); // $pConfig->set($this->selfUser['id'], 'frio', 'schema', '---');
$pConfig->set($this->selfUser['id'], 'frio', 'nav_bg', '#123456'); // $pConfig->set($this->selfUser['id'], 'frio', 'nav_bg', '#123456');
$pConfig->set($this->selfUser['id'], 'frio', 'link_color', '#123456'); // $pConfig->set($this->selfUser['id'], 'frio', 'link_color', '#123456');
$pConfig->set($this->selfUser['id'], 'frio', 'background_color', '#123456'); // $pConfig->set($this->selfUser['id'], 'frio', 'background_color', '#123456');
$user = api_get_user(); // $user = api_get_user();
self::assertSelfUser($user); // self::assertSelfUser($user);
// self::assertEquals('123456', $user['profile_sidebar_fill_color']); // self::assertEquals('123456', $user['profile_sidebar_fill_color']);
// self::assertEquals('123456', $user['profile_link_color']); // self::assertEquals('123456', $user['profile_link_color']);
// self::assertEquals('123456', $user['profile_background_color']); // self::assertEquals('123456', $user['profile_background_color']);
@ -728,8 +728,8 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithGetId() public function testApiGetUserWithGetId()
{ {
$_GET['user_id'] = $this->otherUser['id']; // $_GET['user_id'] = $this->otherUser['id'];
self::assertOtherUser(api_get_user()); // self::assertOtherUser(api_get_user());
} }
/** /**
@ -739,9 +739,9 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithWrongGetId() public function testApiGetUserWithWrongGetId()
{ {
$this->expectException(\Friendica\Network\HTTPException\BadRequestException::class); // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
$_GET['user_id'] = $this->wrongUserId; // $_GET['user_id'] = $this->wrongUserId;
self::assertOtherUser(api_get_user()); // self::assertOtherUser(api_get_user());
} }
/** /**
@ -751,8 +751,8 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithGetName() public function testApiGetUserWithGetName()
{ {
$_GET['screen_name'] = $this->selfUser['nick']; // $_GET['screen_name'] = $this->selfUser['nick'];
self::assertSelfUser(api_get_user()); // self::assertSelfUser(api_get_user());
} }
/** /**
@ -762,8 +762,8 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithGetUrl() public function testApiGetUserWithGetUrl()
{ {
$_GET['profileurl'] = $this->selfUser['nurl']; // $_GET['profileurl'] = $this->selfUser['nurl'];
self::assertSelfUser(api_get_user()); // self::assertSelfUser(api_get_user());
} }
/** /**
@ -773,10 +773,10 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithNumericCalledApi() public function testApiGetUserWithNumericCalledApi()
{ {
global $called_api; // global $called_api;
$called_api = ['api_path']; // $called_api = ['api_path'];
DI::args()->setArgv(['', $this->otherUser['id'] . '.json']); // DI::args()->setArgv(['', $this->otherUser['id'] . '.json']);
self::assertOtherUser(api_get_user()); // self::assertOtherUser(api_get_user());
} }
/** /**
@ -786,9 +786,9 @@ class ApiTest extends FixtureTest
*/ */
public function testApiGetUserWithCalledApi() public function testApiGetUserWithCalledApi()
{ {
global $called_api; // global $called_api;
$called_api = ['api', 'api_path']; // $called_api = ['api', 'api_path'];
self::assertSelfUser(api_get_user()); // self::assertSelfUser(api_get_user());
} }
/** /**