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