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