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