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