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