]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
Fix test data
[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\Notification;
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         'post-content' => [
183                 [
184                         'uri-id' => 1,
185                         'body'   => 'Parent status',
186                         'plink'  => 'http://localhost/display/1',
187                 ],
188                 [
189                         'uri-id' => 2,
190                         'body'   => 'Reply',
191                         'plink'  => 'http://localhost/display/2',
192                 ],
193                 [
194                         'uri-id' => 3,
195                         'body'   => 'Other user status',
196                         'plink'  => 'http://localhost/display/3',
197                 ],
198                 [
199                         'uri-id' => 4,
200                         'body'   => 'Friend user reply',
201                         'plink'  => 'http://localhost/display/4',
202                 ],
203                 [
204                         'uri-id' => 5,
205                         'body'   => '[share]Shared status[/share]',
206                         'plink'  => 'http://localhost/display/5',
207                 ],
208                 [
209                         'uri-id' => 6,
210                         'body'   => 'Friend user status',
211                         'plink'  => 'http://localhost/display/6',
212                 ],
213         ],
214         'post-user' => [
215                 [
216                         'id'          => 1,
217                         'uri-id'      => 1,
218                         'uid'         => 42,
219                         'contact-id'  => 42,
220                         'unseen'      => 1,
221                         'origin'      => 1,
222                 ],
223                 [
224                         'id'          => 2,
225                         'uri-id'      => 2,
226                         'uid'         => 42,
227                         'contact-id'  => 42,
228                         'unseen'      => 0,
229                         'origin'      => 1,
230                 ],
231                 [
232                         'id'          => 3,
233                         'uri-id'      => 3,
234                         'uid'         => 42,
235                         'contact-id'  => 43,
236                         'unseen'      => 0,
237                         'origin'      => 1,
238                 ],
239                 [
240                         'id'          => 4,
241                         'uri-id'      => 4,
242                         'uid'         => 42,
243                         'contact-id'  => 44,
244                         'unseen'      => 0,
245                         'origin'      => 1,
246                 ],
247                 [
248                         'id'          => 5,
249                         'uri-id'      => 5,
250                         'uid'         => 42,
251                         'contact-id'  => 42,
252                         'unseen'      => 0,
253                         'origin'      => 1,
254                 ],
255                 [
256                         'id'          => 6,
257                         'uri-id'      => 6,
258                         'uid'         => 42,
259                         'contact-id'  => 44,
260                         'unseen'      => 0,
261                         'origin'      => 1,
262                 ],
263
264         ],
265         'item'    => [
266                 [
267                         'id'          => 1,
268                         'uri-id'      => 1,
269                         'visible'     => 1,
270                         'contact-id'  => 42,
271                         'author-id'   => 42,
272                         'owner-id'    => 42,
273                         'causer-id'   => 42,
274                         'uid'         => 42,
275                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
276                         'unseen'      => 1,
277                         'parent'      => 1,
278                         'parent-uri-id' => 1,
279                         'thr-parent-id' => 1,
280                         'gravity'     => GRAVITY_PARENT,
281                         'author-link' => 'http://localhost/profile/selfcontact',
282                         'wall'        => 1,
283                         'starred'     => 1,
284                         'origin'      => 1,
285                         'allow_cid'   => '',
286                         'allow_gid'   => '',
287                         'deny_cid'    => '',
288                         'deny_gid'    => '',
289                         'guid'        => '1',
290                 ],
291                 [
292                         'id'          => 2,
293                         'uri-id'      => 2,
294                         'visible'     => 1,
295                         'contact-id'  => 42,
296                         'author-id'   => 42,
297                         'owner-id'    => 42,
298                         'causer-id'   => 42,
299                         'uid'         => 42,
300                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
301                         'unseen'      => 0,
302                         'parent'      => 1,
303                         'parent-uri-id' => 1,
304                         'thr-parent-id' => 1,
305                         'gravity'     => GRAVITY_COMMENT,
306                         'author-link' => 'http://localhost/profile/selfcontact',
307                         'wall'        => 1,
308                         'starred'     => 0,
309                         'origin'      => 1,
310                         'guid'        => '2',
311                 ],
312                 [
313                         'id'          => 3,
314                         'uri-id'      => 3,
315                         'visible'     => 1,
316                         'contact-id'  => 43,
317                         'author-id'   => 43,
318                         'owner-id'    => 42,
319                         'causer-id'   => 43,
320                         'uid'         => 42,
321                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
322                         'unseen'      => 0,
323                         'parent'      => 3,
324                         'parent-uri-id' => 3,
325                         'thr-parent-id' => 3,
326                         'gravity'     => GRAVITY_PARENT,
327                         'author-link' => 'http://localhost/profile/othercontact',
328                         'wall'        => 1,
329                         'starred'     => 0,
330                         'origin'      => 1,
331                         'guid'        => '3',
332                 ],
333                 [
334                         'id'          => 4,
335                         'uri-id'      => 4,
336                         'visible'     => 1,
337                         'contact-id'  => 44,
338                         'author-id'   => 44,
339                         'owner-id'    => 42,
340                         'causer-id'   => 44,
341                         'uid'         => 42,
342                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
343                         'unseen'      => 0,
344                         'body'        => 'Friend user reply',
345                         'parent'      => 1,
346                         'parent-uri-id' => 1,
347                         'thr-parent-id' => 1,
348                         'gravity'     => GRAVITY_COMMENT,
349                         'author-link' => 'http://localhost/profile/othercontact',
350                         'wall'        => 1,
351                         'starred'     => 0,
352                         'origin'      => 1,
353                         'guid'        => '4',
354                 ],
355                 [
356
357                         'id'          => 5,
358                         'uri-id'      => 5,
359                         'visible'     => 1,
360                         'contact-id'  => 42,
361                         'author-id'   => 42,
362                         'owner-id'    => 42,
363                         'causer-id'   => 42,
364                         'uid'         => 42,
365                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
366                         'unseen'      => 0,
367                         'parent'      => 1,
368                         'parent-uri-id' => 1,
369                         'thr-parent-id' => 1,
370                         'gravity'     => GRAVITY_COMMENT,
371                         'author-link' => 'http://localhost/profile/othercontact',
372                         'wall'        => 1,
373                         'starred'     => 0,
374                         'origin'      => 1,
375                         'allow_cid'   => '',
376                         'allow_gid'   => '',
377                         'deny_cid'    => '',
378                         'deny_gid'    => '',
379                         'guid'        => '5',
380                 ],
381                 [
382                         'id'          => 6,
383                         'uri-id'      => 6,
384                         'visible'     => 1,
385                         'contact-id'  => 44,
386                         'author-id'   => 44,
387                         'owner-id'    => 42,
388                         'causer-id'   => 44,
389                         'uid'         => 42,
390                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
391                         'unseen'      => 0,
392                         'parent'      => 6,
393                         'parent-uri-id' => 6,
394                         'thr-parent-id' => 6,
395                         'gravity'     => GRAVITY_PARENT,
396                         'author-link' => 'http://localhost/profile/othercontact',
397                         'wall'        => 1,
398                         'starred'     => 0,
399                         'origin'      => 1,
400                         'guid'        => '6',
401                 ],
402         ],
403         'notify' => [
404                 [
405                         'id' => 1,
406                         'type' => 8,
407                         'name' => 'Reply to',
408                         'url' => 'http://localhost/display/1',
409                         'photo' => 'http://localhost/',
410                         'date' => '2020-01-01 12:12:02',
411                         'msg' => 'A test reply from an item',
412                         'uid' => 42,
413                         'link' => 'http://localhost/notification/1',
414                         'iid' => 4,
415                         'seen' => 0,
416                         'verb' => '',
417                         'otype' => Notification\ObjectType::ITEM,
418                         'name_cache' => 'Reply to',
419                         'msg_cache' => 'A test reply from an item',
420                 ],
421         ],
422         'post-thread'  => [
423                 [
424                         'uri-id'     => 1,
425                         'author-id'  => 42,
426                         'owner-id'   => 42,
427                 ],
428                 [
429                         'uri-id'     => 3,
430                         'author-id'  => 43,
431                         'owner-id'   => 43,
432                 ],
433                 [
434                         'uri-id'     => 6,
435                         'author-id'  => 44,
436                         'owner-id'   => 44,
437                 ],
438         ],
439         'post-thread-user'  => [
440                 [
441                         'uri-id'     => 1,
442                         'uid'        => 42,
443                         'wall'       => 1,
444                 ],
445                 [
446                         'uri-id'     => 3,
447                         'uid'        => 0,
448                         'wall'       => 1,
449                 ],
450                 [
451                         'uri-id'     => 6,
452                         'uid'        => 0,
453                         'wall'       => 1,
454                 ],
455         ],
456         'profile' => [
457                 [
458                         'id' => 1,
459                         'uid' => 42,
460                 ],
461         ],
462         'group'   => [
463                 [
464                         'id'      => 1,
465                         'uid'     => 42,
466                         'visible' => 1,
467                         'name'    => 'Visible list',
468                 ],
469                 [
470                         'id'      => 2,
471                         'uid'     => 42,
472                         'visible' => 0,
473                         'name'    => 'Private list',
474                 ],
475         ],
476         'search'  => [
477                 [
478                         'id'   => 1,
479                         'term' => 'Saved search',
480                         'uid'  => 42,
481                 ],
482         ],
483 ];