Improving test data

This commit is contained in:
Michael 2021-02-05 07:14:09 +00:00
parent bc6d87afa8
commit 15b709594f
2 changed files with 66 additions and 8 deletions

View File

@ -1819,15 +1819,10 @@ function api_statuses_networkpublic_timeline($type)
}
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
// $statuses = Post::toArray(Post::selectForUser(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params));
$statuses = Post::toArray(Post::select(Item::DISPLAY_FIELDLIST, $condition, $params));
if (empty($statuses)) {
return ['status' => [], 'statuses2' => $statuses, 'condition' => $condition, 'params' => $params, 'db' => DBA::errorNo(), 'msg' => DBA::errorMessage()];
}
$statuses = Post::toArray(Post::selectForUser(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params));
$ret = api_format_items($statuses, $user_info, false, $type);
if (empty($ret)) {
return ['status' => [], 'ret' => $ret, 'statuses' => $statuses, 'condition' => $condition, 'params' => $params, 'db' => DBA::errorNo(), 'msg' => DBA::errorMessage()];
}
bindComments($ret);
$data = ['status' => $ret];

View File

@ -253,6 +253,21 @@ return [
'uid' => 42,
'wall' => 1,
],
[
'uri-id' => 1,
'uid' => 0,
'wall' => 0,
],
[
'uri-id' => 3,
'uid' => 0,
'wall' => 0,
],
[
'uri-id' => 6,
'uid' => 0,
'wall' => 0,
],
],
'post-user' => [
[
@ -303,6 +318,54 @@ return [
'unseen' => 0,
'origin' => 1,
],
[
'id' => 7,
'uri-id' => 1,
'uid' => 0,
'contact-id' => 42,
'unseen' => 1,
'origin' => 0,
],
[
'id' => 8,
'uri-id' => 2,
'uid' => 0,
'contact-id' => 42,
'unseen' => 0,
'origin' => 0,
],
[
'id' => 9,
'uri-id' => 3,
'uid' => 0,
'contact-id' => 43,
'unseen' => 0,
'origin' => 0,
],
[
'id' => 10,
'uri-id' => 4,
'uid' => 0,
'contact-id' => 44,
'unseen' => 0,
'origin' => 0,
],
[
'id' => 11,
'uri-id' => 5,
'uid' => 0,
'contact-id' => 42,
'unseen' => 0,
'origin' => 0,
],
[
'id' => 12,
'uri-id' => 6,
'uid' => 0,
'contact-id' => 44,
'unseen' => 0,
'origin' => 0,
],
],
'item' => [