3 * @copyright Copyright (C) 2010-2022, 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',
115 'uri' => 'http://localhost/profile/selfcontact',
120 'uri' => 'http://localhost/profile/othercontact',
125 'uri' => 'http://localhost/profile/friendcontact',
130 'uri' => 'http://localhost/profile/mutualcontact',
139 'name' => 'Self contact',
140 'nick' => 'selfcontact',
142 'nurl' => 'http://localhost/profile/selfcontact',
143 'url' => 'http://localhost/profile/selfcontact',
144 'about' => 'User used in tests',
145 '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-----",
146 'pubkey' => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
149 'rel' => Contact::FOLLOWER,
150 'network' => Protocol::DFRN,
151 'location' => 'DFRN',
153 // Having the same name and nick allows us to test
154 // the fallback to api_get_nick() in api_get_user()
159 'name' => 'othercontact',
160 'nick' => 'othercontact',
162 'nurl' => 'http://localhost/profile/othercontact',
163 'url' => 'http://localhost/profile/othercontact',
166 'rel' => Contact::NOTHING,
167 'network' => Protocol::DFRN,
168 'location' => 'DFRN',
174 'name' => 'Friend contact',
175 'nick' => 'friendcontact',
177 'nurl' => 'http://localhost/profile/friendcontact',
178 'url' => 'http://localhost/profile/friendcontact',
181 'rel' => Contact::SHARING,
182 'network' => Protocol::DFRN,
183 'location' => 'DFRN',
189 'name' => 'Friend contact',
190 'nick' => 'friendcontact',
192 'nurl' => 'http://localhost/profile/friendcontact',
193 'url' => 'http://localhost/profile/friendcontact',
196 'rel' => Contact::SHARING,
197 'network' => Protocol::DFRN,
198 'location' => 'DFRN',
204 'name' => 'Mutual contact',
205 'nick' => 'mutualcontact',
207 'nurl' => 'http://localhost/profile/mutualcontact',
208 'url' => 'http://localhost/profile/mutualcontact',
211 'rel' => Contact::FRIEND,
212 'network' => Protocol::DFRN,
213 'location' => 'DFRN',
219 'name' => 'Mutual contact',
220 'nick' => 'mutualcontact',
222 'nurl' => 'http://localhost/profile/mutualcontact',
223 'url' => 'http://localhost/profile/mutualcontact',
226 'rel' => Contact::SHARING,
227 'network' => Protocol::DFRN,
228 'location' => 'DFRN',
234 'name' => 'Self contact',
235 'nick' => 'selfcontact',
237 'nurl' => 'http://localhost/profile/selfcontact',
238 'url' => 'http://localhost/profile/selfcontact',
239 'about' => 'User used in tests',
242 'rel' => Contact::FOLLOWER,
243 'network' => Protocol::DFRN,
244 'location' => 'DFRN',
249 "url" => "http://localhost/profile/selfcontact",
253 "following" => "http://localhost/following/selfcontact",
254 "followers" => "http://localhost/followers/selfcontact",
255 "inbox" => "http://localhost/inbox/selfcontact",
256 "outbox" => "http://localhost/outbox/selfcontact",
257 "sharedinbox" => "http://localhost/inbox",
258 "manually-approve" => 1,
260 "nick" => "selfcontact",
261 "name" => "Self contact",
262 "about" => "User used in tests",
265 "photo" => "http://localhost/photo/profile/admin.jpeg",
267 "addr" => "selfcontact@localhost",
269 "pubkey" => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
270 "subscribe" => "/follow?url={uri}",
273 "generator" => "Friendica 'Siberian Iris' 2021.12-dev-1443",
274 "following_count" => 0,
275 "followers_count" => 0,
276 "statuses_count" => 0,
277 "updated" => "2021-11-19 19:17:59",
287 'name' => 'http://activitystrea.ms/schema/1.0/like',
291 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
295 'name' => 'http://purl.org/zot/activity/attendyes',
299 'name' => 'http://purl.org/zot/activity/attendno',
303 'name' => 'http://purl.org/zot/activity/attendmaybe',
307 'name' => 'http://activitystrea.ms/schema/1.0/follow',
311 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
315 'name' => 'http://activitystrea.ms/schema/1.0/post',
321 'body' => 'Parent status',
322 'plink' => 'http://localhost/display/1',
327 'plink' => 'http://localhost/display/2',
331 'body' => 'Other user status',
332 'plink' => 'http://localhost/display/3',
336 'body' => 'Friend user reply',
337 'plink' => 'http://localhost/display/4',
341 'body' => '[share]Shared status[/share]',
342 'plink' => 'http://localhost/display/5',
346 'body' => 'Friend user status',
347 'plink' => 'http://localhost/display/6',
351 'title' => 'item_title',
352 'body' => 'perspiciatis impedit voluptatem quis molestiae ea qui ' .
353 'reiciendis dolorum aut ducimus sunt consequatur inventore dolor ' .
354 'officiis pariatur doloremque nemo culpa aut quidem qui dolore ' .
355 'laudantium atque commodi alias voluptatem non possimus aperiam ' .
356 'ipsum rerum consequuntur aut amet fugit quia aliquid praesentium ' .
357 'repellendus quibusdam et et inventore mollitia rerum sit autem ' .
358 'pariatur maiores ipsum accusantium perferendis vel sit possimus ' .
359 'veritatis nihil distinctio qui eum repellat officia illum quos ' .
360 'impedit quam iste esse unde qui suscipit aut facilis ut inventore ' .
361 'omnis exercitationem quo magnam consequatur maxime aut illum ' .
362 'soluta quaerat natus unde aspernatur et sed beatae nihil ullam ' .
363 'temporibus corporis ratione blanditiis perspiciatis impedit ' .
364 'voluptatem quis molestiae ea qui reiciendis dolorum aut ducimus ' .
365 'sunt consequatur inventore dolor officiis pariatur doloremque ' .
366 'nemo culpa aut quidem qui dolore laudantium atque commodi alias ' .
367 'voluptatem non possimus aperiam ipsum rerum consequuntur aut ' .
368 'amet fugit quia aliquid praesentium repellendus quibusdam et et ' .
369 'inventore mollitia rerum sit autem pariatur maiores ipsum accusantium ' .
370 'perferendis vel sit possimus veritatis nihil distinctio qui eum ' .
371 'repellat officia illum quos impedit quam iste esse unde qui ' .
372 'suscipit aut facilis ut inventore omnis exercitationem quo magnam ' .
373 'consequatur maxime aut illum soluta quaerat natus unde aspernatur ' .
374 'et sed beatae nihil ullam temporibus corporis ratione blanditiis',
375 'plink' => 'http://localhost/display/6',
381 'parent-uri-id' => 1,
382 'thr-parent-id' => 1,
383 'gravity' => GRAVITY_PARENT,
384 'network' => Protocol::DFRN,
389 'private' => Item::PUBLIC,
396 'parent-uri-id' => 1,
397 'thr-parent-id' => 1,
398 'gravity' => GRAVITY_COMMENT,
399 'network' => Protocol::DFRN,
404 'private' => Item::PUBLIC,
411 'parent-uri-id' => 3,
412 'thr-parent-id' => 3,
413 'gravity' => GRAVITY_PARENT,
414 'network' => Protocol::DFRN,
419 'private' => Item::PUBLIC,
426 'parent-uri-id' => 1,
427 'thr-parent-id' => 1,
428 'gravity' => GRAVITY_COMMENT,
429 'network' => Protocol::DFRN,
434 'private' => Item::PUBLIC,
441 'parent-uri-id' => 1,
442 'thr-parent-id' => 1,
443 'gravity' => GRAVITY_COMMENT,
444 'network' => Protocol::DFRN,
449 'private' => Item::PUBLIC,
456 'parent-uri-id' => 6,
457 'thr-parent-id' => 6,
458 'gravity' => GRAVITY_PARENT,
459 'network' => Protocol::DFRN,
464 'private' => Item::PUBLIC,
471 'parent-uri-id' => 7,
472 'thr-parent-id' => 7,
473 'gravity' => GRAVITY_PARENT,
474 'network' => Protocol::DFRN,
479 'private' => Item::PUBLIC,
497 'parent-uri-id' => 1,
498 'thr-parent-id' => 1,
499 'private' => Item::PUBLIC,
501 'gravity' => GRAVITY_PARENT,
502 'network' => Protocol::DFRN,
513 'parent-uri-id' => 1,
514 'thr-parent-id' => 1,
515 'gravity' => GRAVITY_COMMENT,
516 'network' => Protocol::DFRN,
521 'private' => Item::PUBLIC,
534 'parent-uri-id' => 3,
535 'thr-parent-id' => 3,
536 'gravity' => GRAVITY_PARENT,
537 'network' => Protocol::DFRN,
542 'private' => Item::PUBLIC,
555 'parent-uri-id' => 1,
556 'thr-parent-id' => 1,
557 'gravity' => GRAVITY_COMMENT,
558 'network' => Protocol::DFRN,
563 'private' => Item::PUBLIC,
576 'parent-uri-id' => 1,
577 'thr-parent-id' => 1,
578 'gravity' => GRAVITY_COMMENT,
579 'network' => Protocol::DFRN,
584 'private' => Item::PUBLIC,
597 'parent-uri-id' => 6,
598 'thr-parent-id' => 6,
599 'gravity' => GRAVITY_PARENT,
600 'network' => Protocol::DFRN,
605 'private' => Item::PUBLIC,
618 'parent-uri-id' => 1,
619 'thr-parent-id' => 1,
620 'gravity' => GRAVITY_PARENT,
621 'network' => Protocol::DFRN,
626 'private' => Item::PUBLIC,
639 'parent-uri-id' => 1,
640 'thr-parent-id' => 1,
641 'gravity' => GRAVITY_COMMENT,
642 'network' => Protocol::DFRN,
647 'private' => Item::PUBLIC,
660 'parent-uri-id' => 3,
661 'thr-parent-id' => 3,
662 'gravity' => GRAVITY_PARENT,
663 'network' => Protocol::DFRN,
668 'private' => Item::PUBLIC,
681 'parent-uri-id' => 1,
682 'thr-parent-id' => 1,
683 'gravity' => GRAVITY_COMMENT,
684 'network' => Protocol::DFRN,
689 'private' => Item::PUBLIC,
702 'parent-uri-id' => 1,
703 'thr-parent-id' => 1,
704 'gravity' => GRAVITY_COMMENT,
705 'network' => Protocol::DFRN,
710 'private' => Item::PUBLIC,
727 'parent-uri-id' => 6,
728 'thr-parent-id' => 6,
729 'private' => Item::PUBLIC,
731 'gravity' => GRAVITY_PARENT,
732 'network' => Protocol::DFRN,
748 'parent-uri-id' => 7,
749 'thr-parent-id' => 7,
750 'private' => Item::PUBLIC,
752 'gravity' => GRAVITY_PARENT,
753 'network' => Protocol::DFRN,
765 'network' => Protocol::DFRN,
772 'network' => Protocol::DFRN,
779 'network' => Protocol::DFRN,
786 'network' => Protocol::DFRN,
789 'post-thread-user' => [
799 'network' => Protocol::DFRN,
812 'network' => Protocol::DFRN,
825 'network' => Protocol::DFRN,
838 'network' => Protocol::DFRN,
851 'network' => Protocol::DFRN,
859 'post-user-id' => 12,
864 'network' => Protocol::DFRN,
877 'network' => Protocol::DFRN,
885 'post-user-id' => 12,
890 'network' => Protocol::DFRN,
899 'name' => 'Reply to',
900 'url' => 'http://localhost/display/1',
901 'photo' => 'http://localhost/',
902 'date' => '2020-01-01 12:12:02',
903 'msg' => 'A test reply from an item',
905 'link' => 'http://localhost/notification/1',
908 'verb' => \Friendica\Protocol\Activity::POST,
909 'otype' => Notification\ObjectType::ITEM,
910 'name_cache' => 'Reply to',
911 'msg_cache' => 'A test reply from an item',
925 'name' => 'Visible list',
931 'name' => 'Private list',
954 'term' => 'Saved search',