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