Use public contact ids where they should be used in API fixture data

This commit is contained in:
Hypolite Petovan 2024-02-25 01:30:23 -05:00
parent ba0a8069c4
commit 0d922b75af
2 changed files with 106 additions and 106 deletions

View File

@ -373,9 +373,9 @@ return [
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_PARENT, 'gravity' => Item::GRAVITY_PARENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 42, 'author-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -388,9 +388,9 @@ return [
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 42, 'author-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -403,7 +403,7 @@ return [
'thr-parent-id' => 3, 'thr-parent-id' => 3,
'gravity' => Item::GRAVITY_PARENT, 'gravity' => Item::GRAVITY_PARENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 43, 'author-id' => 43,
'causer-id' => 43, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
@ -418,9 +418,9 @@ return [
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 44, 'author-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -433,9 +433,9 @@ return [
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 42, 'author-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -448,9 +448,9 @@ return [
'thr-parent-id' => 6, 'thr-parent-id' => 6,
'gravity' => Item::GRAVITY_PARENT, 'gravity' => Item::GRAVITY_PARENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 44, 'author-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -463,9 +463,9 @@ return [
'thr-parent-id' => 7, 'thr-parent-id' => 7,
'gravity' => Item::GRAVITY_PARENT, 'gravity' => Item::GRAVITY_PARENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 44, 'author-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -478,10 +478,10 @@ return [
'id' => 1, 'id' => 1,
'uri-id' => 1, 'uri-id' => 1,
'visible' => 1, 'visible' => 1,
'contact-id' => 42, 'contact-id' => 43,
'author-id' => 42, 'author-id' => 43,
'owner-id' => 42, 'owner-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'uid' => 42, 'uid' => 42,
'vid' => 8, 'vid' => 8,
'unseen' => 1, 'unseen' => 1,
@ -498,16 +498,16 @@ return [
'id' => 2, 'id' => 2,
'uri-id' => 2, 'uri-id' => 2,
'uid' => 42, 'uid' => 42,
'contact-id' => 42, 'contact-id' => 43,
'unseen' => 0, 'unseen' => 0,
'origin' => 1, 'origin' => 1,
'parent-uri-id' => 1, 'parent-uri-id' => 1,
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 42, 'author-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -526,7 +526,7 @@ return [
'thr-parent-id' => 3, 'thr-parent-id' => 3,
'gravity' => Item::GRAVITY_PARENT, 'gravity' => Item::GRAVITY_PARENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 43, 'author-id' => 43,
'causer-id' => 43, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
@ -540,16 +540,16 @@ return [
'id' => 4, 'id' => 4,
'uri-id' => 4, 'uri-id' => 4,
'uid' => 42, 'uid' => 42,
'contact-id' => 44, 'contact-id' => 45,
'unseen' => 0, 'unseen' => 0,
'origin' => 1, 'origin' => 1,
'parent-uri-id' => 1, 'parent-uri-id' => 1,
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 44, 'author-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -561,16 +561,16 @@ return [
'id' => 5, 'id' => 5,
'uri-id' => 5, 'uri-id' => 5,
'uid' => 42, 'uid' => 42,
'contact-id' => 42, 'contact-id' => 43,
'unseen' => 0, 'unseen' => 0,
'origin' => 1, 'origin' => 1,
'parent-uri-id' => 1, 'parent-uri-id' => 1,
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 42, 'author-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -582,16 +582,16 @@ return [
'id' => 6, 'id' => 6,
'uri-id' => 6, 'uri-id' => 6,
'uid' => 42, 'uid' => 42,
'contact-id' => 44, 'contact-id' => 45,
'unseen' => 0, 'unseen' => 0,
'origin' => 1, 'origin' => 1,
'parent-uri-id' => 6, 'parent-uri-id' => 6,
'thr-parent-id' => 6, 'thr-parent-id' => 6,
'gravity' => Item::GRAVITY_PARENT, 'gravity' => Item::GRAVITY_PARENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 44, 'author-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -603,16 +603,16 @@ return [
'id' => 7, 'id' => 7,
'uri-id' => 1, 'uri-id' => 1,
'uid' => 0, 'uid' => 0,
'contact-id' => 42, 'contact-id' => 43,
'unseen' => 1, 'unseen' => 1,
'origin' => 0, 'origin' => 0,
'parent-uri-id' => 1, 'parent-uri-id' => 1,
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_PARENT, 'gravity' => Item::GRAVITY_PARENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 42, 'author-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -624,16 +624,16 @@ return [
'id' => 8, 'id' => 8,
'uri-id' => 2, 'uri-id' => 2,
'uid' => 0, 'uid' => 0,
'contact-id' => 42, 'contact-id' => 43,
'unseen' => 0, 'unseen' => 0,
'origin' => 0, 'origin' => 0,
'parent-uri-id' => 1, 'parent-uri-id' => 1,
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 42, 'author-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -652,7 +652,7 @@ return [
'thr-parent-id' => 3, 'thr-parent-id' => 3,
'gravity' => Item::GRAVITY_PARENT, 'gravity' => Item::GRAVITY_PARENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 43, 'author-id' => 43,
'causer-id' => 43, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
@ -666,16 +666,16 @@ return [
'id' => 10, 'id' => 10,
'uri-id' => 4, 'uri-id' => 4,
'uid' => 0, 'uid' => 0,
'contact-id' => 44, 'contact-id' => 45,
'unseen' => 0, 'unseen' => 0,
'origin' => 0, 'origin' => 0,
'parent-uri-id' => 1, 'parent-uri-id' => 1,
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 44, 'author-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -687,16 +687,16 @@ return [
'id' => 11, 'id' => 11,
'uri-id' => 5, 'uri-id' => 5,
'uid' => 0, 'uid' => 0,
'contact-id' => 42, 'contact-id' => 43,
'unseen' => 0, 'unseen' => 0,
'origin' => 0, 'origin' => 0,
'parent-uri-id' => 1, 'parent-uri-id' => 1,
'thr-parent-id' => 1, 'thr-parent-id' => 1,
'gravity' => Item::GRAVITY_COMMENT, 'gravity' => Item::GRAVITY_COMMENT,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'owner-id' => 42, 'owner-id' => 43,
'author-id' => 42, 'author-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'vid' => 8, 'vid' => 8,
'private' => Item::PUBLIC, 'private' => Item::PUBLIC,
'global' => true, 'global' => true,
@ -708,10 +708,10 @@ return [
'id' => 12, 'id' => 12,
'uri-id' => 6, 'uri-id' => 6,
'visible' => 1, 'visible' => 1,
'contact-id' => 44, 'contact-id' => 45,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 42, 'owner-id' => 43,
'causer-id' => 44, 'causer-id' => 45,
'uid' => 0, 'uid' => 0,
'vid' => 8, 'vid' => 8,
'unseen' => 0, 'unseen' => 0,
@ -729,10 +729,10 @@ return [
'id' => 13, 'id' => 13,
'uri-id' => 7, 'uri-id' => 7,
'visible' => 1, 'visible' => 1,
'contact-id' => 44, 'contact-id' => 45,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 42, 'owner-id' => 43,
'causer-id' => 44, 'causer-id' => 45,
'uid' => 0, 'uid' => 0,
'vid' => 8, 'vid' => 8,
'unseen' => 0, 'unseen' => 0,
@ -751,10 +751,10 @@ return [
'id' => 14, 'id' => 14,
'uri-id' => 100, 'uri-id' => 100,
'visible' => 1, 'visible' => 1,
'contact-id' => 44, 'contact-id' => 45,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 42, 'owner-id' => 43,
'causer-id' => 44, 'causer-id' => 45,
'uid' => 0, 'uid' => 0,
'vid' => 8, 'vid' => 8,
'unseen' => 0, 'unseen' => 0,
@ -772,9 +772,9 @@ return [
'post-thread' => [ 'post-thread' => [
[ [
'uri-id' => 1, 'uri-id' => 1,
'author-id' => 42, 'author-id' => 43,
'owner-id' => 42, 'owner-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
], ],
[ [
@ -786,16 +786,16 @@ return [
], ],
[ [
'uri-id' => 6, 'uri-id' => 6,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 44, 'owner-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
], ],
[ [
'uri-id' => 7, 'uri-id' => 7,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 44, 'owner-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
], ],
], ],
@ -805,10 +805,10 @@ return [
'uid' => 42, 'uid' => 42,
'wall' => 1, 'wall' => 1,
'post-user-id' => 1, 'post-user-id' => 1,
'author-id' => 42, 'author-id' => 43,
'owner-id' => 42, 'owner-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'contact-id' => 42, 'contact-id' => 43,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'starred' => 1, 'starred' => 1,
'origin' => 1, 'origin' => 1,
@ -831,10 +831,10 @@ return [
'uid' => 42, 'uid' => 42,
'wall' => 1, 'wall' => 1,
'post-user-id' => 6, 'post-user-id' => 6,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 44, 'owner-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'contact-id' => 44, 'contact-id' => 45,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'starred' => 0, 'starred' => 0,
'origin' => 1, 'origin' => 1,
@ -844,10 +844,10 @@ return [
'uid' => 0, 'uid' => 0,
'wall' => 0, 'wall' => 0,
'post-user-id' => 7, 'post-user-id' => 7,
'author-id' => 42, 'author-id' => 43,
'owner-id' => 42, 'owner-id' => 43,
'causer-id' => 42, 'causer-id' => 43,
'contact-id' => 42, 'contact-id' => 43,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'starred' => 0, 'starred' => 0,
'origin' => 0, 'origin' => 0,
@ -870,10 +870,10 @@ return [
'uid' => 0, 'uid' => 0,
'wall' => 0, 'wall' => 0,
'post-user-id' => 12, 'post-user-id' => 12,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 44, 'owner-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'contact-id' => 44, 'contact-id' => 45,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'starred' => 0, 'starred' => 0,
'origin' => 0, 'origin' => 0,
@ -883,10 +883,10 @@ return [
'uid' => 42, 'uid' => 42,
'wall' => 1, 'wall' => 1,
'post-user-id' => 7, 'post-user-id' => 7,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 44, 'owner-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'contact-id' => 44, 'contact-id' => 45,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'starred' => 0, 'starred' => 0,
'origin' => 1, 'origin' => 1,
@ -896,10 +896,10 @@ return [
'uid' => 0, 'uid' => 0,
'wall' => 0, 'wall' => 0,
'post-user-id' => 12, 'post-user-id' => 12,
'author-id' => 44, 'author-id' => 45,
'owner-id' => 44, 'owner-id' => 45,
'causer-id' => 44, 'causer-id' => 45,
'contact-id' => 44, 'contact-id' => 45,
'network' => Protocol::DFRN, 'network' => Protocol::DFRN,
'starred' => 0, 'starred' => 0,
'origin' => 0, 'origin' => 0,
@ -948,12 +948,12 @@ return [
[ [
'id' => 1, 'id' => 1,
'gid' => 1, 'gid' => 1,
'contact-id' => 42, 'contact-id' => 43,
], ],
[ [
'id' => 2, 'id' => 2,
'gid' => 1, 'gid' => 1,
'contact-id' => 42, 'contact-id' => 43,
], ],
[ [
'id' => 3, 'id' => 3,

View File

@ -38,7 +38,7 @@ class UserTimelineTest extends ApiTest
{ {
$response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'user_id' => 42, 'user_id' => 43, // Public contact id
'max_id' => 10, 'max_id' => 10,
'exclude_replies' => true, 'exclude_replies' => true,
'conversation_id' => 1, 'conversation_id' => 1,
@ -63,7 +63,7 @@ class UserTimelineTest extends ApiTest
{ {
$response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [])) $response = (new UserTimeline(DI::mstdnError(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), []))
->run($this->httpExceptionMock, [ ->run($this->httpExceptionMock, [
'user_id' => 42, 'user_id' => 43, // Public contact id
'page' => -2, 'page' => -2,
]); ]);