3 * @copyright Copyright (C) 2010-2021, the Friendica project
5 * @license GNU AGPL version 3 or any later version
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.
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.
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/>.
22 use Friendica\Core\Protocol;
23 use Friendica\Model\Contact;
24 use Friendica\Model\Item;
25 use Friendica\Model\Notification;
38 // Base test config to avoid notice messages
43 'v' => 'http://localhost',
52 'k' => 'worker_dont_fork',
57 'k' => 'curl_timeout',
69 'username' => 'Test user',
70 'nickname' => 'selfcontact',
72 'prvkey' => "-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDVqxF9kIgtgRL0+q+jTi578FA1r1+crEmlYc0pdxcbmmrhjuRc\nrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/KHVks7eQ4yr4MxTRlsxo5qf2o\nnbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjsQPX240vGNXIkfLiAWwIDAQAB\nAoGBAIwuiPIdggqAtWQ+mD8HCx5LQwSFw6/xpPu5F7ZNqL52aAsGCbL3o2QoIG4c\na1qf9Ot16BNgNBqxQF3hzRTkBMrKYlmNTUkwJXun/zjQJq2JvOlcrSuXlIucUjs4\nXekVN25aYPHrX9m2FEIUwZTb4UYXbR80KbIDI53BkQ6EwSbpAkEA7aO49CR2Hf1Y\n1d2GaUI/Z0wvbj//+t0Kg0bPt16ca8KVjEQQA5ylsDaiw510jDz9NBQxSOk6If23\nUeRixc1RDQJBAOYtN4YnPM1Zfp6IxXlqMCc+xUWRTPEPFt+WpG+v79koNamAeA6o\nZzTl92hl58IqSdbgojeE2zXWQRvlimFMLQcCQQCV6jND0byyLqFcSeQBg0l8YROK\n+dUC7W80YfeoNod3c8nkMwvnO2tLPyxvO2XLEq6prBNra7bAus5rWyj0oBIBAkEA\n1EvUMFm0TLpEfLgtWuTD8Q6GKLnxO0ztjd+FXrXpBGN/ywyArxRHzJRmctW6wmz6\nmcOqGobhIHCysKYv0bnOtQJAc2M5RwlASHH4jGJzXgt3nboyiJfufM0RV9iry3ho\nCXQRWAONKoLqnsfC6qNP8OzY8FMJcwmPWj7Q/6z6yLBFTA==\n-----END RSA PRIVATE KEY-----",
73 'pubkey' => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----", 'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
111 'uri' => 'http://localhost/profile/selfcontact',
116 'uri' => 'http://localhost/profile/othercontact',
121 'uri' => 'http://localhost/profile/friendcontact',
126 'uri' => 'http://localhost/profile/mutualcontact',
135 'name' => 'Self contact',
136 'nick' => 'selfcontact',
138 'nurl' => 'http://localhost/profile/selfcontact',
139 'url' => 'http://localhost/profile/selfcontact',
140 'about' => 'User used in tests',
141 'prvkey' => "-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDVqxF9kIgtgRL0+q+jTi578FA1r1+crEmlYc0pdxcbmmrhjuRc\nrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/KHVks7eQ4yr4MxTRlsxo5qf2o\nnbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjsQPX240vGNXIkfLiAWwIDAQAB\nAoGBAIwuiPIdggqAtWQ+mD8HCx5LQwSFw6/xpPu5F7ZNqL52aAsGCbL3o2QoIG4c\na1qf9Ot16BNgNBqxQF3hzRTkBMrKYlmNTUkwJXun/zjQJq2JvOlcrSuXlIucUjs4\nXekVN25aYPHrX9m2FEIUwZTb4UYXbR80KbIDI53BkQ6EwSbpAkEA7aO49CR2Hf1Y\n1d2GaUI/Z0wvbj//+t0Kg0bPt16ca8KVjEQQA5ylsDaiw510jDz9NBQxSOk6If23\nUeRixc1RDQJBAOYtN4YnPM1Zfp6IxXlqMCc+xUWRTPEPFt+WpG+v79koNamAeA6o\nZzTl92hl58IqSdbgojeE2zXWQRvlimFMLQcCQQCV6jND0byyLqFcSeQBg0l8YROK\n+dUC7W80YfeoNod3c8nkMwvnO2tLPyxvO2XLEq6prBNra7bAus5rWyj0oBIBAkEA\n1EvUMFm0TLpEfLgtWuTD8Q6GKLnxO0ztjd+FXrXpBGN/ywyArxRHzJRmctW6wmz6\nmcOqGobhIHCysKYv0bnOtQJAc2M5RwlASHH4jGJzXgt3nboyiJfufM0RV9iry3ho\nCXQRWAONKoLqnsfC6qNP8OzY8FMJcwmPWj7Q/6z6yLBFTA==\n-----END RSA PRIVATE KEY-----",
142 'pubkey' => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
145 'rel' => Contact::FOLLOWER,
146 'network' => Protocol::DFRN,
147 'location' => 'DFRN',
149 // Having the same name and nick allows us to test
150 // the fallback to api_get_nick() in api_get_user()
155 'name' => 'othercontact',
156 'nick' => 'othercontact',
158 'nurl' => 'http://localhost/profile/othercontact',
159 'url' => 'http://localhost/profile/othercontact',
162 'rel' => Contact::NOTHING,
163 'network' => Protocol::DFRN,
164 'location' => 'DFRN',
170 'name' => 'Friend contact',
171 'nick' => 'friendcontact',
173 'nurl' => 'http://localhost/profile/friendcontact',
174 'url' => 'http://localhost/profile/friendcontact',
177 'rel' => Contact::SHARING,
178 'network' => Protocol::DFRN,
179 'location' => 'DFRN',
185 'name' => 'Friend contact',
186 'nick' => 'friendcontact',
188 'nurl' => 'http://localhost/profile/friendcontact',
189 'url' => 'http://localhost/profile/friendcontact',
192 'rel' => Contact::SHARING,
193 'network' => Protocol::DFRN,
194 'location' => 'DFRN',
200 'name' => 'Mutual contact',
201 'nick' => 'mutualcontact',
203 'nurl' => 'http://localhost/profile/mutualcontact',
204 'url' => 'http://localhost/profile/mutualcontact',
207 'rel' => Contact::FRIEND,
208 'network' => Protocol::DFRN,
209 'location' => 'DFRN',
215 'name' => 'Mutual contact',
216 'nick' => 'mutualcontact',
218 'nurl' => 'http://localhost/profile/mutualcontact',
219 'url' => 'http://localhost/profile/mutualcontact',
222 'rel' => Contact::SHARING,
223 'network' => Protocol::DFRN,
224 'location' => 'DFRN',
230 'name' => 'Self contact',
231 'nick' => 'selfcontact',
233 'nurl' => 'http://localhost/profile/selfcontact',
234 'url' => 'http://localhost/profile/selfcontact',
235 'about' => 'User used in tests',
238 'rel' => Contact::FOLLOWER,
239 'network' => Protocol::DFRN,
240 'location' => 'DFRN',
245 "url" => "http://localhost/profile/selfcontact",
249 "following" => "http://localhost/following/selfcontact",
250 "followers" => "http://localhost/followers/selfcontact",
251 "inbox" => "http://localhost/inbox/selfcontact",
252 "outbox" => "http://localhost/outbox/selfcontact",
253 "sharedinbox" => "http://localhost/inbox",
254 "manually-approve" => 1,
256 "nick" => "selfcontact",
257 "name" => "Self contact",
258 "about" => "User used in tests",
261 "photo" => "http://localhost/photo/profile/admin.jpeg",
263 "addr" => "selfcontact@localhost",
265 "pubkey" => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
266 "subscribe" => "/follow?url={uri}",
269 "generator" => "Friendica 'Siberian Iris' 2021.12-dev-1443",
270 "following_count" => 0,
271 "followers_count" => 0,
272 "statuses_count" => 0,
273 "updated" => "2021-11-19 19:17:59",
283 'name' => 'http://activitystrea.ms/schema/1.0/like',
287 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
291 'name' => 'http://purl.org/zot/activity/attendyes',
295 'name' => 'http://purl.org/zot/activity/attendno',
299 'name' => 'http://purl.org/zot/activity/attendmaybe',
303 'name' => 'http://activitystrea.ms/schema/1.0/follow',
307 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
311 'name' => 'http://activitystrea.ms/schema/1.0/post',
317 'body' => 'Parent status',
318 'plink' => 'http://localhost/display/1',
323 'plink' => 'http://localhost/display/2',
327 'body' => 'Other user status',
328 'plink' => 'http://localhost/display/3',
332 'body' => 'Friend user reply',
333 'plink' => 'http://localhost/display/4',
337 'body' => '[share]Shared status[/share]',
338 'plink' => 'http://localhost/display/5',
342 'body' => 'Friend user status',
343 'plink' => 'http://localhost/display/6',
349 'parent-uri-id' => 1,
350 'thr-parent-id' => 1,
351 'gravity' => GRAVITY_PARENT,
352 'network' => Protocol::DFRN,
357 'private' => Item::PUBLIC,
364 'parent-uri-id' => 1,
365 'thr-parent-id' => 1,
366 'gravity' => GRAVITY_COMMENT,
367 'network' => Protocol::DFRN,
372 'private' => Item::PUBLIC,
379 'parent-uri-id' => 3,
380 'thr-parent-id' => 3,
381 'gravity' => GRAVITY_PARENT,
382 'network' => Protocol::DFRN,
387 'private' => Item::PUBLIC,
394 'parent-uri-id' => 1,
395 'thr-parent-id' => 1,
396 'gravity' => GRAVITY_COMMENT,
397 'network' => Protocol::DFRN,
402 'private' => Item::PUBLIC,
409 'parent-uri-id' => 1,
410 'thr-parent-id' => 1,
411 'gravity' => GRAVITY_COMMENT,
412 'network' => Protocol::DFRN,
417 'private' => Item::PUBLIC,
424 'parent-uri-id' => 6,
425 'thr-parent-id' => 6,
426 'gravity' => GRAVITY_PARENT,
427 'network' => Protocol::DFRN,
432 'private' => Item::PUBLIC,
450 'parent-uri-id' => 1,
451 'thr-parent-id' => 1,
452 'private' => Item::PUBLIC,
454 'gravity' => GRAVITY_PARENT,
455 'network' => Protocol::DFRN,
466 'parent-uri-id' => 1,
467 'thr-parent-id' => 1,
468 'gravity' => GRAVITY_COMMENT,
469 'network' => Protocol::DFRN,
474 'private' => Item::PUBLIC,
487 'parent-uri-id' => 3,
488 'thr-parent-id' => 3,
489 'gravity' => GRAVITY_PARENT,
490 'network' => Protocol::DFRN,
495 'private' => Item::PUBLIC,
508 'parent-uri-id' => 1,
509 'thr-parent-id' => 1,
510 'gravity' => GRAVITY_COMMENT,
511 'network' => Protocol::DFRN,
516 'private' => Item::PUBLIC,
529 'parent-uri-id' => 1,
530 'thr-parent-id' => 1,
531 'gravity' => GRAVITY_COMMENT,
532 'network' => Protocol::DFRN,
537 'private' => Item::PUBLIC,
550 'parent-uri-id' => 6,
551 'thr-parent-id' => 6,
552 'gravity' => GRAVITY_PARENT,
553 'network' => Protocol::DFRN,
558 'private' => Item::PUBLIC,
571 'parent-uri-id' => 1,
572 'thr-parent-id' => 1,
573 'gravity' => GRAVITY_PARENT,
574 'network' => Protocol::DFRN,
579 'private' => Item::PUBLIC,
592 'parent-uri-id' => 1,
593 'thr-parent-id' => 1,
594 'gravity' => GRAVITY_COMMENT,
595 'network' => Protocol::DFRN,
600 'private' => Item::PUBLIC,
613 'parent-uri-id' => 3,
614 'thr-parent-id' => 3,
615 'gravity' => GRAVITY_PARENT,
616 'network' => Protocol::DFRN,
621 'private' => Item::PUBLIC,
634 'parent-uri-id' => 1,
635 'thr-parent-id' => 1,
636 'gravity' => GRAVITY_COMMENT,
637 'network' => Protocol::DFRN,
642 'private' => Item::PUBLIC,
655 'parent-uri-id' => 1,
656 'thr-parent-id' => 1,
657 'gravity' => GRAVITY_COMMENT,
658 'network' => Protocol::DFRN,
663 'private' => Item::PUBLIC,
680 'parent-uri-id' => 6,
681 'thr-parent-id' => 6,
682 'private' => Item::PUBLIC,
684 'gravity' => GRAVITY_PARENT,
685 'network' => Protocol::DFRN,
697 'network' => Protocol::DFRN,
704 'network' => Protocol::DFRN,
711 'network' => Protocol::DFRN,
714 'post-thread-user' => [
724 'network' => Protocol::DFRN,
737 'network' => Protocol::DFRN,
750 'network' => Protocol::DFRN,
763 'network' => Protocol::DFRN,
776 'network' => Protocol::DFRN,
784 'post-user-id' => 12,
789 'network' => Protocol::DFRN,
798 'name' => 'Reply to',
799 'url' => 'http://localhost/display/1',
800 'photo' => 'http://localhost/',
801 'date' => '2020-01-01 12:12:02',
802 'msg' => 'A test reply from an item',
804 'link' => 'http://localhost/notification/1',
807 'verb' => \Friendica\Protocol\Activity::POST,
808 'otype' => Notification\ObjectType::ITEM,
809 'name_cache' => 'Reply to',
810 'msg_cache' => 'A test reply from an item',
824 'name' => 'Visible list',
830 'name' => 'Private list',
843 'term' => 'Saved search',