]> git.mxchange.org Git - friendica.git/blob - tests/datasets/api.fixture.php
More missing table entries for tests
[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'      => 0,
62                         'uid'     => 0,
63                 ],
64                 [
65                         'id'      => 42,
66                         'uid'     => 42,
67                         'name'    => 'Self contact',
68                         'nick'    => 'selfcontact',
69                         'self'    => 1,
70                         'nurl'    => 'http://localhost/profile/selfcontact',
71                         'url'     => 'http://localhost/profile/selfcontact',
72                         'about'   => 'User used in tests',
73                         'pending' => 0,
74                         'blocked' => 0,
75                         'rel'     => 1,
76                         'network' => 'dfrn',
77                 ],
78                 // Having the same name and nick allows us to test
79                 // the fallback to api_get_nick() in api_get_user()
80                 [
81                         'id'      => 43,
82                         'uid'     => 0,
83                         'name'    => 'othercontact',
84                         'nick'    => 'othercontact',
85                         'self'    => 0,
86                         'nurl'    => 'http://localhost/profile/othercontact',
87                         'url'     => 'http://localhost/profile/othercontact',
88                         'pending' => 0,
89                         'blocked' => 0,
90                         'rel'     => 0,
91                         'network' => '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                 ],
106         ],
107         'item-uri'    => [
108                 [
109                         'id'   => 1,
110                         'uri'  => '1',
111                         'guid' => '1',
112                 ],
113                 [
114                         'id'   => 2,
115                         'uri'  => '2',
116                         'guid' => '2',
117                 ],
118                 [
119                         'id'   => 3,
120                         'uri'  => '3',
121                         'guid' => '3',
122                 ],
123                 [
124                         'id'   => 4,
125                         'uri'  => '4',
126                         'guid' => '4',
127                 ],
128                 [
129                         'id'   => 5,
130                         'uri'  => '5',
131                         'guid' => '5',
132                 ],
133                 [
134                         'id'   => 6,
135                         'uri'  => '6',
136                         'guid' => '6',
137                 ],
138         ],
139         'permissionset' => [
140                 [
141                         'id' => 0,
142                 ]
143         ],
144         'item'    => [
145                 [
146                         'id'          => 1,
147                         'uri-id'      => 1,
148                         'visible'     => 1,
149                         'contact-id'  => 42,
150                         'author-id'   => 42,
151                         'owner-id'    => 42,
152                         'uid'         => 42,
153                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
154                         'unseen'      => 1,
155                         'body'        => 'Parent status',
156                         'parent'      => 1,
157                         'author-link' => 'http://localhost/profile/selfcontact',
158                         'wall'        => 1,
159                         'starred'     => 1,
160                         'origin'      => 1,
161                         'allow_cid'   => '',
162                         'allow_gid'   => '',
163                         'deny_cid'    => '',
164                         'deny_gid'    => '',
165                 ],
166                 [
167                         'id'          => 2,
168                         'uri-id'      => 2,
169                         'visible'     => 1,
170                         'contact-id'  => 42,
171                         'author-id'   => 42,
172                         'owner-id'    => 42,
173                         'uid'         => 42,
174                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
175                         'unseen'      => 0,
176                         'body'        => 'Reply',
177                         'parent'      => 1,
178                         'author-link' => 'http://localhost/profile/selfcontact',
179                         'wall'        => 1,
180                         'starred'     => 0,
181                         'origin'      => 1,
182                 ],
183                 [
184
185                         'id'          => 3,
186                         'uri-id'      => 3,
187                         'visible'     => 1,
188                         'contact-id'  => 43,
189                         'author-id'   => 43,
190                         'owner-id'    => 42,
191                         'uid'         => 42,
192                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
193                         'unseen'      => 0,
194                         'body'        => 'Other user status',
195                         'parent'      => 3,
196                         'author-link' => 'http://localhost/profile/othercontact',
197                         'wall'        => 1,
198                         'starred'     => 0,
199                         'origin'      => 1,
200                 ],
201                 [
202                         'id'          => 4,
203                         'uri-id'      => 4,
204                         'visible'     => 1,
205                         'contact-id'  => 44,
206                         'author-id'   => 44,
207                         'owner-id'    => 42,
208                         'uid'         => 42,
209                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
210                         'unseen'      => 0,
211                         'body'        => 'Friend user reply',
212                         'parent'      => 1,
213                         'author-link' => 'http://localhost/profile/othercontact',
214                         'wall'        => 1,
215                         'starred'     => 0,
216                         'origin'      => 1,
217                 ],
218                 [
219
220                         'id'          => 5,
221                         'uri-id'      => 5,
222                         'visible'     => 1,
223                         'contact-id'  => 42,
224                         'author-id'   => 42,
225                         'owner-id'    => 42,
226                         'uid'         => 42,
227                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
228                         'unseen'      => 0,
229                         'body'        => '[share]Shared status[/share]',
230                         'parent'      => 1,
231                         'author-link' => 'http://localhost/profile/othercontact',
232                         'wall'        => 1,
233                         'starred'     => 0,
234                         'origin'      => 1,
235                         'allow_cid'   => '',
236                         'allow_gid'   => '',
237                         'deny_cid'    => '',
238                         'deny_gid'    => '',
239                 ],
240                 [
241                         'id'          => 6,
242                         'uri-id'      => 6,
243                         'visible'     => 1,
244                         'contact-id'  => 44,
245                         'author-id'   => 44,
246                         'owner-id'    => 42,
247                         'uid'         => 42,
248                         'verb'        => 'http://activitystrea.ms/schema/1.0/post',
249                         'unseen'      => 0,
250                         'body'        => 'Friend user status',
251                         'parent'      => 6,
252                         'author-link' => 'http://localhost/profile/othercontact',
253                         'wall'        => 1,
254                         'starred'     => 0,
255                         'origin'      => 1,
256                 ],
257         ],
258         'notify' => [
259                 [
260                         'id' => 1,
261                         'type' => 8,
262                         'name' => 'Reply to',
263                         'url' => 'http://localhost/display/1',
264                         'photo' => 'http://localhost/',
265                         'date' => '2020-01-01 12:12:02',
266                         'msg' => 'A test reply from an item',
267                         'uid' => 42,
268                         'link' => 'http://localhost/notification/1',
269                         'iid' => 4,
270                         'seen' => 0,
271                         'verb' => '',
272                         'otype' => 'item',
273                         'name_cache' => 'Reply to',
274                         'msg_cache' => 'A test reply from an item',
275                 ],
276         ],
277         'thread'  => [
278                 [
279                         'iid'        => 1,
280                         'visible'    => 1,
281                         'contact-id' => 42,
282                         'author-id'  => 42,
283                         'owner-id'   => 42,
284                         'uid'        => 42,
285                         'wall'       => 1,
286                 ],
287                 [
288                         'iid'        => 3,
289                         'visible'    => 1,
290                         'contact-id' => 43,
291                         'author-id'  => 43,
292                         'owner-id'   => 43,
293                         'uid'        => 0,
294                         'wall'       => 1,
295                 ],
296                 [
297                         'iid'        => 6,
298                         'visible'    => 1,
299                         'contact-id' => 44,
300                         'author-id'  => 44,
301                         'owner-id'   => 44,
302                         'uid'        => 0,
303                         'wall'       => 1,
304                 ],
305         ],
306         'profile' => [
307                 [
308                         'id' => 1,
309                         'uid' => 42,
310                 ],
311         ],
312         'group'   => [
313                 [
314                         'id'      => 1,
315                         'uid'     => 42,
316                         'visible' => 1,
317                         'name'    => 'Visible list',
318                 ],
319                 [
320                         'id'      => 2,
321                         'uid'     => 42,
322                         'visible' => 0,
323                         'name'    => 'Private list',
324                 ],
325         ],
326         'search'  => [
327                 [
328                         'id'   => 1,
329                         'term' => 'Saved search',
330                         'uid'  => 42,
331                 ],
332         ],
333 ];