]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
Merge remote-tracking branch 'upstream/develop' into fixed-view
[friendica.git] / tests / datasets / api.fixture.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2020, Friendica
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21
22 use Friendica\Model\Notify;
23
24 return [
25         // Empty these tables
26         'cache',
27         'conversation',
28         'pconfig',
29         'photo',
30         'workerqueue',
31         'mail',
32         'post-delivery-data',
33         // Base test config to avoid notice messages
34         'config'  => [
35                 [
36                         'cat' => 'system',
37                         'k'   => 'url',
38                         'v'   => 'http://localhost',
39                 ],
40                 [
41                         'cat' => 'config',
42                         'k'   => 'hostname',
43                         'v'   => 'localhost',
44                 ],
45                 [
46                         'cat' => 'system',
47                         'k'   => 'worker_dont_fork',
48                         'v'   => '1',
49                 ],
50         ],
51         'user'    => [
52                 [
53                         'uid'      => 42,
54                         'username' => 'Test user',
55                         'nickname' => 'selfcontact',
56                         'verified' => 1,
57                         'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
58                         'theme'    => 'frio',
59                 ],
60         ],
61         'contact' => [
62                 [
63                         'id'      => 42,
64                         'uid'     => 42,
65                         'name'    => 'Self contact',
66                         'nick'    => 'selfcontact',
67                         'self'    => 1,
68                         'nurl'    => 'http://localhost/profile/selfcontact',
69                         'url'     => 'http://localhost/profile/selfcontact',
70                         'about'   => 'User used in tests',
71                         'pending' => 0,
72                         'blocked' => 0,
73                         'rel'     => 1,
74                         'network' => 'dfrn',
75                         'location' => 'DFRN',
76                 ],
77                 // Having the same name and nick allows us to test
78                 // the fallback to api_get_nick() in api_get_user()
79                 [
80                         'id'      => 43,
81                         'uid'     => 0,
82                         'name'    => 'othercontact',
83                         'nick'    => 'othercontact',
84                         'self'    => 0,
85                         'nurl'    => 'http://localhost/profile/othercontact',
86                         'url'     => 'http://localhost/profile/othercontact',
87                         'pending' => 0,
88                         'blocked' => 0,
89                         'rel'     => 0,
90                         'network' => 'dfrn',
91                         'location' => 'DFRN',
92                 ],
93                 [
94                         'id'      => 44,
95                         'uid'     => 42,
96                         'name'    => 'Friend contact',
97                         'nick'    => 'friendcontact',
98                         'self'    => 0,
99                         'nurl'    => 'http://localhost/profile/friendcontact',
100                         'url'     => 'http://localhost/profile/friendcontact',
101                         'pending' => 0,
102                         'blocked' => 0,
103                         'rel'     => 2,
104                         'network' => 'dfrn',
105                         'location' => 'DFRN',
106                 ],
107                 [
108                         'id'      => 45,
109                         'uid'     => 0,
110                         'name'    => 'Friend contact',
111                         'nick'    => 'friendcontact',
112                         'self'    => 0,
113                         'nurl'    => 'http://localhost/profile/friendcontact',
114                         'url'     => 'http://localhost/profile/friendcontact',
115                         'pending' => 0,
116                         'blocked' => 0,
117                         'rel'     => 2,
118                         'network' => 'dfrn',
119                         'location' => 'DFRN',
120                 ],
121                 [
122                         'id'      => 46,
123                         'uid'     => 42,
124                         'name'    => 'Mutual contact',
125                         'nick'    => 'mutualcontact',
126                         'self'    => 0,
127                         'nurl'    => 'http://localhost/profile/mutualcontact',
128                         'url'     => 'http://localhost/profile/mutualcontact',
129                         'pending' => 0,
130                         'blocked' => 0,
131                         'rel'     => 3,
132                         'network' => 'dfrn',
133                         'location' => 'DFRN',
134                 ],
135                 [
136                         'id'      => 47,
137                         'uid'     => 0,
138                         'name'    => 'Mutual contact',
139                         'nick'    => 'mutualcontact',
140                         'self'    => 0,
141                         'nurl'    => 'http://localhost/profile/mutualcontact',
142                         'url'     => 'http://localhost/profile/mutualcontact',
143                         'pending' => 0,
144                         'blocked' => 0,
145                         'rel'     => 2,
146                         'network' => 'dfrn',
147                         'location' => 'DFRN',
148                 ],
149         ],
150         'item-uri'    => [
151                 [
152                         'id'   => 1,
153                         'uri'  => '1',
154                         'guid' => '1',
155                 ],
156                 [
157                         'id'   => 2,
158                         'uri'  => '2',
159                         'guid' => '2',
160                 ],
161                 [
162                         'id'   => 3,
163                         'uri'  => '3',
164                         'guid' => '3',
165                 ],
166                 [
167                         'id'   => 4,
168                         'uri'  => '4',
169                         'guid' => '4',
170                 ],
171                 [
172                         'id'   => 5,
173                         'uri'  => '5',
174                         'guid' => '5',
175                 ],
176                 [
177                         'id'   => 6,
178                         'uri'  => '6',
179                         'guid' => '6',
180                 ],
181         ],
182         'item'    => [
183                 [
184                         'id'          => 1,
185                         'uri-id'      => 1,
186                         'visible'     => 1,
187                         'contact-id'  => 42,
188                         'author-id'   => 42,
189                         'owner-id'    => 42,
190                         'causer-id'   => 42,
191                         'uid'         => 42,
192                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
193                         'unseen'      => 1,
194                         'body'        => 'Parent status',
195                         'parent'      => 1,
196                         'parent-uri-id' => 1,
197                         'thr-parent-id' => 1,
198                         'gravity'     => GRAVITY_PARENT,
199                         'author-link' => 'http://localhost/profile/selfcontact',
200                         'wall'        => 1,
201                         'starred'     => 1,
202                         'origin'      => 1,
203                         'allow_cid'   => '',
204                         'allow_gid'   => '',
205                         'deny_cid'    => '',
206                         'deny_gid'    => '',
207                         'guid'        => '1',
208                         'plink'       => 'http://localhost/display/1',
209                 ],
210                 [
211                         'id'          => 2,
212                         'uri-id'      => 2,
213                         'visible'     => 1,
214                         'contact-id'  => 42,
215                         'author-id'   => 42,
216                         'owner-id'    => 42,
217                         'causer-id'   => 42,
218                         'uid'         => 42,
219                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
220                         'unseen'      => 0,
221                         'body'        => 'Reply',
222                         'parent'      => 1,
223                         'parent-uri-id' => 1,
224                         'thr-parent-id' => 1,
225                         'gravity'     => GRAVITY_COMMENT,
226                         'author-link' => 'http://localhost/profile/selfcontact',
227                         'wall'        => 1,
228                         'starred'     => 0,
229                         'origin'      => 1,
230                         'guid'        => '2',
231                         'plink'       => 'http://localhost/display/2',
232                 ],
233                 [
234
235                         'id'          => 3,
236                         'uri-id'      => 3,
237                         'visible'     => 1,
238                         'contact-id'  => 43,
239                         'author-id'   => 43,
240                         'owner-id'    => 42,
241                         'causer-id'   => 43,
242                         'uid'         => 42,
243                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
244                         'unseen'      => 0,
245                         'body'        => 'Other user status',
246                         'parent'      => 3,
247                         'parent-uri-id' => 3,
248                         'thr-parent-id' => 3,
249                         'gravity'     => GRAVITY_PARENT,
250                         'author-link' => 'http://localhost/profile/othercontact',
251                         'wall'        => 1,
252                         'starred'     => 0,
253                         'origin'      => 1,
254                         'guid'        => '3',
255                         'plink'       => 'http://localhost/display/3',
256                 ],
257                 [
258                         'id'          => 4,
259                         'uri-id'      => 4,
260                         'visible'     => 1,
261                         'contact-id'  => 44,
262                         'author-id'   => 44,
263                         'owner-id'    => 42,
264                         'causer-id'   => 44,
265                         'uid'         => 42,
266                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
267                         'unseen'      => 0,
268                         'body'        => 'Friend user reply',
269                         'parent'      => 1,
270                         'parent-uri-id' => 1,
271                         'thr-parent-id' => 1,
272                         'gravity'     => GRAVITY_COMMENT,
273                         'author-link' => 'http://localhost/profile/othercontact',
274                         'wall'        => 1,
275                         'starred'     => 0,
276                         'origin'      => 1,
277                         'guid'        => '4',
278                         'plink'       => 'http://localhost/display/4',
279                 ],
280                 [
281
282                         'id'          => 5,
283                         'uri-id'      => 5,
284                         'visible'     => 1,
285                         'contact-id'  => 42,
286                         'author-id'   => 42,
287                         'owner-id'    => 42,
288                         'causer-id'   => 42,
289                         'uid'         => 42,
290                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
291                         'unseen'      => 0,
292                         'body'        => '[share]Shared status[/share]',
293                         'parent'      => 1,
294                         'parent-uri-id' => 1,
295                         'thr-parent-id' => 1,
296                         'gravity'     => GRAVITY_COMMENT,
297                         'author-link' => 'http://localhost/profile/othercontact',
298                         'wall'        => 1,
299                         'starred'     => 0,
300                         'origin'      => 1,
301                         'allow_cid'   => '',
302                         'allow_gid'   => '',
303                         'deny_cid'    => '',
304                         'deny_gid'    => '',
305                         'guid'        => '5',
306                         'plink'       => 'http://localhost/display/5',
307                 ],
308                 [
309                         'id'          => 6,
310                         'uri-id'      => 6,
311                         'visible'     => 1,
312                         'contact-id'  => 44,
313                         'author-id'   => 44,
314                         'owner-id'    => 42,
315                         'causer-id'   => 44,
316                         'uid'         => 42,
317                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
318                         'unseen'      => 0,
319                         'body'        => 'Friend user status',
320                         'parent'      => 6,
321                         'parent-uri-id' => 6,
322                         'thr-parent-id' => 6,
323                         'gravity'     => GRAVITY_PARENT,
324                         'author-link' => 'http://localhost/profile/othercontact',
325                         'wall'        => 1,
326                         'starred'     => 0,
327                         'origin'      => 1,
328                         'guid'        => '6',
329                         'plink'       => 'http://localhost/display/6',
330                 ],
331         ],
332         'notify' => [
333                 [
334                         'id' => 1,
335                         'type' => 8,
336                         'name' => 'Reply to',
337                         'url' => 'http://localhost/display/1',
338                         'photo' => 'http://localhost/',
339                         'date' => '2020-01-01 12:12:02',
340                         'msg' => 'A test reply from an item',
341                         'uid' => 42,
342                         'link' => 'http://localhost/notification/1',
343                         'iid' => 4,
344                         'seen' => 0,
345                         'verb' => '',
346                         'otype' => Notify\ObjectType::ITEM,
347                         'name_cache' => 'Reply to',
348                         'msg_cache' => 'A test reply from an item',
349                 ],
350         ],
351         'thread'  => [
352                 [
353                         'iid'        => 1,
354                         'uri-id'     => 1,
355                         'visible'    => 1,
356                         'contact-id' => 42,
357                         'author-id'  => 42,
358                         'owner-id'   => 42,
359                         'uid'        => 42,
360                         'wall'       => 1,
361                 ],
362                 [
363                         'iid'        => 3,
364                         'uri-id'     => 3,
365                         'visible'    => 1,
366                         'contact-id' => 43,
367                         'author-id'  => 43,
368                         'owner-id'   => 43,
369                         'uid'        => 0,
370                         'wall'       => 1,
371                 ],
372                 [
373                         'iid'        => 6,
374                         'uri-id'     => 6,
375                         'visible'    => 1,
376                         'contact-id' => 44,
377                         'author-id'  => 44,
378                         'owner-id'   => 44,
379                         'uid'        => 0,
380                         'wall'       => 1,
381                 ],
382         ],
383         'profile' => [
384                 [
385                         'id' => 1,
386                         'uid' => 42,
387                 ],
388         ],
389         'group'   => [
390                 [
391                         'id'      => 1,
392                         'uid'     => 42,
393                         'visible' => 1,
394                         'name'    => 'Visible list',
395                 ],
396                 [
397                         'id'      => 2,
398                         'uid'     => 42,
399                         'visible' => 0,
400                         'name'    => 'Private list',
401                 ],
402         ],
403         'search'  => [
404                 [
405                         'id'   => 1,
406                         'term' => 'Saved search',
407                         'uid'  => 42,
408                 ],
409         ],
410 ];