]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
Merge remote-tracking branch 'upstream/develop' into rework-notifications
[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                         'uid'         => 42,
191                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
192                         'unseen'      => 1,
193                         'body'        => 'Parent status',
194                         'parent'      => 1,
195                         'author-link' => 'http://localhost/profile/selfcontact',
196                         'wall'        => 1,
197                         'starred'     => 1,
198                         'origin'      => 1,
199                         'allow_cid'   => '',
200                         'allow_gid'   => '',
201                         'deny_cid'    => '',
202                         'deny_gid'    => '',
203                         'guid'        => '1',
204                         'plink'       => 'http://localhost/display/1',
205                 ],
206                 [
207                         'id'          => 2,
208                         'uri-id'      => 2,
209                         'visible'     => 1,
210                         'contact-id'  => 42,
211                         'author-id'   => 42,
212                         'owner-id'    => 42,
213                         'uid'         => 42,
214                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
215                         'unseen'      => 0,
216                         'body'        => 'Reply',
217                         'parent'      => 1,
218                         'author-link' => 'http://localhost/profile/selfcontact',
219                         'wall'        => 1,
220                         'starred'     => 0,
221                         'origin'      => 1,
222                         'guid'        => '2',
223                         'plink'       => 'http://localhost/display/2',
224                 ],
225                 [
226
227                         'id'          => 3,
228                         'uri-id'      => 3,
229                         'visible'     => 1,
230                         'contact-id'  => 43,
231                         'author-id'   => 43,
232                         'owner-id'    => 42,
233                         'uid'         => 42,
234                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
235                         'unseen'      => 0,
236                         'body'        => 'Other user status',
237                         'parent'      => 3,
238                         'author-link' => 'http://localhost/profile/othercontact',
239                         'wall'        => 1,
240                         'starred'     => 0,
241                         'origin'      => 1,
242                         'guid'        => '3',
243                         'plink'       => 'http://localhost/display/3',
244                 ],
245                 [
246                         'id'          => 4,
247                         'uri-id'      => 4,
248                         'visible'     => 1,
249                         'contact-id'  => 44,
250                         'author-id'   => 44,
251                         'owner-id'    => 42,
252                         'uid'         => 42,
253                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
254                         'unseen'      => 0,
255                         'body'        => 'Friend user reply',
256                         'parent'      => 1,
257                         'author-link' => 'http://localhost/profile/othercontact',
258                         'wall'        => 1,
259                         'starred'     => 0,
260                         'origin'      => 1,
261                         'guid'        => '4',
262                         'plink'       => 'http://localhost/display/4',
263                 ],
264                 [
265
266                         'id'          => 5,
267                         'uri-id'      => 5,
268                         'visible'     => 1,
269                         'contact-id'  => 42,
270                         'author-id'   => 42,
271                         'owner-id'    => 42,
272                         'uid'         => 42,
273                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
274                         'unseen'      => 0,
275                         'body'        => '[share]Shared status[/share]',
276                         'parent'      => 1,
277                         'author-link' => 'http://localhost/profile/othercontact',
278                         'wall'        => 1,
279                         'starred'     => 0,
280                         'origin'      => 1,
281                         'allow_cid'   => '',
282                         'allow_gid'   => '',
283                         'deny_cid'    => '',
284                         'deny_gid'    => '',
285                         'guid'        => '5',
286                         'plink'       => 'http://localhost/display/5',
287                 ],
288                 [
289                         'id'          => 6,
290                         'uri-id'      => 6,
291                         'visible'     => 1,
292                         'contact-id'  => 44,
293                         'author-id'   => 44,
294                         'owner-id'    => 42,
295                         'uid'         => 42,
296                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
297                         'unseen'      => 0,
298                         'body'        => 'Friend user status',
299                         'parent'      => 6,
300                         'author-link' => 'http://localhost/profile/othercontact',
301                         'wall'        => 1,
302                         'starred'     => 0,
303                         'origin'      => 1,
304                         'guid'        => '6',
305                         'plink'       => 'http://localhost/display/6',
306                 ],
307         ],
308         'notify' => [
309                 [
310                         'id' => 1,
311                         'type' => 8,
312                         'name' => 'Reply to',
313                         'url' => 'http://localhost/display/1',
314                         'photo' => 'http://localhost/',
315                         'date' => '2020-01-01 12:12:02',
316                         'msg' => 'A test reply from an item',
317                         'uid' => 42,
318                         'link' => 'http://localhost/notification/1',
319                         'iid' => 4,
320                         'seen' => 0,
321                         'verb' => '',
322                         'otype' => Notify\ObjectType::ITEM,
323                         'name_cache' => 'Reply to',
324                         'msg_cache' => 'A test reply from an item',
325                 ],
326         ],
327         'thread'  => [
328                 [
329                         'iid'        => 1,
330                         'uri-id'     => 1,
331                         'visible'    => 1,
332                         'contact-id' => 42,
333                         'author-id'  => 42,
334                         'owner-id'   => 42,
335                         'uid'        => 42,
336                         'wall'       => 1,
337                 ],
338                 [
339                         'iid'        => 3,
340                         'uri-id'     => 3,
341                         'visible'    => 1,
342                         'contact-id' => 43,
343                         'author-id'  => 43,
344                         'owner-id'   => 43,
345                         'uid'        => 0,
346                         'wall'       => 1,
347                 ],
348                 [
349                         'iid'        => 6,
350                         'uri-id'     => 6,
351                         'visible'    => 1,
352                         'contact-id' => 44,
353                         'author-id'  => 44,
354                         'owner-id'   => 44,
355                         'uid'        => 0,
356                         'wall'       => 1,
357                 ],
358         ],
359         'profile' => [
360                 [
361                         'id' => 1,
362                         'uid' => 42,
363                 ],
364         ],
365         'group'   => [
366                 [
367                         'id'      => 1,
368                         'uid'     => 42,
369                         'visible' => 1,
370                         'name'    => 'Visible list',
371                 ],
372                 [
373                         'id'      => 2,
374                         'uid'     => 42,
375                         'visible' => 0,
376                         'name'    => 'Private list',
377                 ],
378         ],
379         'search'  => [
380                 [
381                         'id'   => 1,
382                         'term' => 'Saved search',
383                         'uid'  => 42,
384                 ],
385         ],
386 ];