]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
Merge pull request #8792 from MrPetovan/task/share-block-guid
[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 return [
23         // Empty these tables
24         'cache',
25         'conversation',
26         'pconfig',
27         'photo',
28         'workerqueue',
29         'mail',
30         'post-delivery-data',
31         // Base test config to avoid notice messages
32         'config'  => [
33                 [
34                         'cat' => 'system',
35                         'k'   => 'url',
36                         'v'   => 'http://localhost',
37                 ],
38                 [
39                         'cat' => 'config',
40                         'k'   => 'hostname',
41                         'v'   => 'localhost',
42                 ],
43                 [
44                         'cat' => 'system',
45                         'k'   => 'worker_dont_fork',
46                         'v'   => '1',
47                 ],
48         ],
49         'user'    => [
50                 [
51                         'uid'      => 42,
52                         'username' => 'Test user',
53                         'nickname' => 'selfcontact',
54                         'verified' => 1,
55                         'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
56                         'theme'    => 'frio',
57                 ],
58         ],
59         'contact' => [
60                 [
61                         'id'      => 42,
62                         'uid'     => 42,
63                         'name'    => 'Self contact',
64                         'nick'    => 'selfcontact',
65                         'self'    => 1,
66                         'nurl'    => 'http://localhost/profile/selfcontact',
67                         'url'     => 'http://localhost/profile/selfcontact',
68                         'about'   => 'User used in tests',
69                         'pending' => 0,
70                         'blocked' => 0,
71                         'rel'     => 1,
72                         'network' => 'dfrn',
73                 ],
74                 // Having the same name and nick allows us to test
75                 // the fallback to api_get_nick() in api_get_user()
76                 [
77                         'id'      => 43,
78                         'uid'     => 0,
79                         'name'    => 'othercontact',
80                         'nick'    => 'othercontact',
81                         'self'    => 0,
82                         'nurl'    => 'http://localhost/profile/othercontact',
83                         'url'     => 'http://localhost/profile/othercontact',
84                         'pending' => 0,
85                         'blocked' => 0,
86                         'rel'     => 0,
87                         'network' => 'dfrn',
88                 ],
89                 [
90                         'id'      => 44,
91                         'uid'     => 42,
92                         'name'    => 'Friend contact',
93                         'nick'    => 'friendcontact',
94                         'self'    => 0,
95                         'nurl'    => 'http://localhost/profile/friendcontact',
96                         'url'     => 'http://localhost/profile/friendcontact',
97                         'pending' => 0,
98                         'blocked' => 0,
99                         'rel'     => 2,
100                         'network' => 'dfrn',
101                 ],
102                 [
103                         'id'      => 45,
104                         'uid'     => 0,
105                         'name'    => 'Friend contact',
106                         'nick'    => 'friendcontact',
107                         'self'    => 0,
108                         'nurl'    => 'http://localhost/profile/friendcontact',
109                         'url'     => 'http://localhost/profile/friendcontact',
110                         'pending' => 0,
111                         'blocked' => 0,
112                         'rel'     => 2,
113                         'network' => 'dfrn',
114                 ],
115                 [
116                         'id'      => 46,
117                         'uid'     => 42,
118                         'name'    => 'Mutual contact',
119                         'nick'    => 'mutualcontact',
120                         'self'    => 0,
121                         'nurl'    => 'http://localhost/profile/mutualcontact',
122                         'url'     => 'http://localhost/profile/mutualcontact',
123                         'pending' => 0,
124                         'blocked' => 0,
125                         'rel'     => 3,
126                         'network' => 'dfrn',
127                 ],
128                 [
129                         'id'      => 47,
130                         'uid'     => 0,
131                         'name'    => 'Mutual contact',
132                         'nick'    => 'mutualcontact',
133                         'self'    => 0,
134                         'nurl'    => 'http://localhost/profile/mutualcontact',
135                         'url'     => 'http://localhost/profile/mutualcontact',
136                         'pending' => 0,
137                         'blocked' => 0,
138                         'rel'     => 2,
139                         'network' => 'dfrn',
140                 ],
141         ],
142         'item-uri'    => [
143                 [
144                         'id'   => 1,
145                         'uri'  => '1',
146                         'guid' => '1',
147                 ],
148                 [
149                         'id'   => 2,
150                         'uri'  => '2',
151                         'guid' => '2',
152                 ],
153                 [
154                         'id'   => 3,
155                         'uri'  => '3',
156                         'guid' => '3',
157                 ],
158                 [
159                         'id'   => 4,
160                         'uri'  => '4',
161                         'guid' => '4',
162                 ],
163                 [
164                         'id'   => 5,
165                         'uri'  => '5',
166                         'guid' => '5',
167                 ],
168                 [
169                         'id'   => 6,
170                         'uri'  => '6',
171                         'guid' => '6',
172                 ],
173         ],
174         'item'    => [
175                 [
176                         'id'          => 1,
177                         'uri-id'      => 1,
178                         'visible'     => 1,
179                         'contact-id'  => 42,
180                         'author-id'   => 42,
181                         'owner-id'    => 42,
182                         'uid'         => 42,
183                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
184                         'unseen'      => 1,
185                         'body'        => 'Parent status',
186                         'parent'      => 1,
187                         'author-link' => 'http://localhost/profile/selfcontact',
188                         'wall'        => 1,
189                         'starred'     => 1,
190                         'origin'      => 1,
191                         'allow_cid'   => '',
192                         'allow_gid'   => '',
193                         'deny_cid'    => '',
194                         'deny_gid'    => '',
195                         'guid'        => '1',
196                         'plink'       => 'http://localhost/display/1',
197                 ],
198                 [
199                         'id'          => 2,
200                         'uri-id'      => 2,
201                         'visible'     => 1,
202                         'contact-id'  => 42,
203                         'author-id'   => 42,
204                         'owner-id'    => 42,
205                         'uid'         => 42,
206                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
207                         'unseen'      => 0,
208                         'body'        => 'Reply',
209                         'parent'      => 1,
210                         'author-link' => 'http://localhost/profile/selfcontact',
211                         'wall'        => 1,
212                         'starred'     => 0,
213                         'origin'      => 1,
214                         'guid'        => '2',
215                         'plink'       => 'http://localhost/display/2',
216                 ],
217                 [
218
219                         'id'          => 3,
220                         'uri-id'      => 3,
221                         'visible'     => 1,
222                         'contact-id'  => 43,
223                         'author-id'   => 43,
224                         'owner-id'    => 42,
225                         'uid'         => 42,
226                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
227                         'unseen'      => 0,
228                         'body'        => 'Other user status',
229                         'parent'      => 3,
230                         'author-link' => 'http://localhost/profile/othercontact',
231                         'wall'        => 1,
232                         'starred'     => 0,
233                         'origin'      => 1,
234                         'guid'        => '3',
235                         'plink'       => 'http://localhost/display/3',
236                 ],
237                 [
238                         'id'          => 4,
239                         'uri-id'      => 4,
240                         'visible'     => 1,
241                         'contact-id'  => 44,
242                         'author-id'   => 44,
243                         'owner-id'    => 42,
244                         'uid'         => 42,
245                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
246                         'unseen'      => 0,
247                         'body'        => 'Friend user reply',
248                         'parent'      => 1,
249                         'author-link' => 'http://localhost/profile/othercontact',
250                         'wall'        => 1,
251                         'starred'     => 0,
252                         'origin'      => 1,
253                         'guid'        => '4',
254                         'plink'       => 'http://localhost/display/4',
255                 ],
256                 [
257
258                         'id'          => 5,
259                         'uri-id'      => 5,
260                         'visible'     => 1,
261                         'contact-id'  => 42,
262                         'author-id'   => 42,
263                         'owner-id'    => 42,
264                         'uid'         => 42,
265                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
266                         'unseen'      => 0,
267                         'body'        => '[share]Shared status[/share]',
268                         'parent'      => 1,
269                         'author-link' => 'http://localhost/profile/othercontact',
270                         'wall'        => 1,
271                         'starred'     => 0,
272                         'origin'      => 1,
273                         'allow_cid'   => '',
274                         'allow_gid'   => '',
275                         'deny_cid'    => '',
276                         'deny_gid'    => '',
277                         'guid'        => '5',
278                         'plink'       => 'http://localhost/display/5',
279                 ],
280                 [
281                         'id'          => 6,
282                         'uri-id'      => 6,
283                         'visible'     => 1,
284                         'contact-id'  => 44,
285                         'author-id'   => 44,
286                         'owner-id'    => 42,
287                         'uid'         => 42,
288                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
289                         'unseen'      => 0,
290                         'body'        => 'Friend user status',
291                         'parent'      => 6,
292                         'author-link' => 'http://localhost/profile/othercontact',
293                         'wall'        => 1,
294                         'starred'     => 0,
295                         'origin'      => 1,
296                         'guid'        => '6',
297                         'plink'       => 'http://localhost/display/6',
298                 ],
299         ],
300         'notify' => [
301                 [
302                         'id' => 1,
303                         'type' => 8,
304                         'name' => 'Reply to',
305                         'url' => 'http://localhost/display/1',
306                         'photo' => 'http://localhost/',
307                         'date' => '2020-01-01 12:12:02',
308                         'msg' => 'A test reply from an item',
309                         'uid' => 42,
310                         'link' => 'http://localhost/notification/1',
311                         'iid' => 4,
312                         'seen' => 0,
313                         'verb' => '',
314                         'otype' => 'item',
315                         'name_cache' => 'Reply to',
316                         'msg_cache' => 'A test reply from an item',
317                 ],
318         ],
319         'thread'  => [
320                 [
321                         'iid'        => 1,
322                         'uri-id'     => 1,
323                         'visible'    => 1,
324                         'contact-id' => 42,
325                         'author-id'  => 42,
326                         'owner-id'   => 42,
327                         'uid'        => 42,
328                         'wall'       => 1,
329                 ],
330                 [
331                         'iid'        => 3,
332                         'uri-id'     => 3,
333                         'visible'    => 1,
334                         'contact-id' => 43,
335                         'author-id'  => 43,
336                         'owner-id'   => 43,
337                         'uid'        => 0,
338                         'wall'       => 1,
339                 ],
340                 [
341                         'iid'        => 6,
342                         'uri-id'     => 6,
343                         'visible'    => 1,
344                         'contact-id' => 44,
345                         'author-id'  => 44,
346                         'owner-id'   => 44,
347                         'uid'        => 0,
348                         'wall'       => 1,
349                 ],
350         ],
351         'profile' => [
352                 [
353                         'id' => 1,
354                         'uid' => 42,
355                 ],
356         ],
357         'group'   => [
358                 [
359                         'id'      => 1,
360                         'uid'     => 42,
361                         'visible' => 1,
362                         'name'    => 'Visible list',
363                 ],
364                 [
365                         'id'      => 2,
366                         'uid'     => 42,
367                         'visible' => 0,
368                         'name'    => 'Private list',
369                 ],
370         ],
371         'search'  => [
372                 [
373                         'id'   => 1,
374                         'term' => 'Saved search',
375                         'uid'  => 42,
376                 ],
377         ],
378 ];