3 * @copyright Copyright (C) 2010-2023, 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;
40 'url' => 'https://friendica.local',
41 'nurl' => 'http://friendica.local',
42 'register_policy' => 0,
43 'registered-users' => 0,
47 // Base test config to avoid notice messages
51 'username' => 'Test user',
52 'nickname' => 'selfcontact',
54 '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-----",
55 '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',
97 'uri' => 'http://localhost/profile/selfcontact',
102 'uri' => 'http://localhost/profile/othercontact',
107 'uri' => 'http://localhost/profile/friendcontact',
112 'uri' => 'http://localhost/profile/mutualcontact',
121 'name' => 'Self contact',
122 'nick' => 'selfcontact',
124 'nurl' => 'http://localhost/profile/selfcontact',
125 'url' => 'http://localhost/profile/selfcontact',
126 'notify' => 'http://localhost/friendica/inbox',
127 'about' => 'User used in tests',
128 '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-----",
129 'pubkey' => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
132 'rel' => Contact::FOLLOWER,
133 'network' => Protocol::DFRN,
134 'location' => 'DFRN',
136 // Having the same name and nick allows us to test
137 // the fallback to api_get_nick() in api_get_user()
142 'name' => 'othercontact',
143 'nick' => 'othercontact',
145 'nurl' => 'http://localhost/profile/othercontact',
146 'url' => 'http://localhost/profile/othercontact',
147 'notify' => 'http://localhost/friendica/inbox',
150 'rel' => Contact::NOTHING,
151 'network' => Protocol::DFRN,
152 'location' => 'DFRN',
158 'name' => 'Friend contact',
159 'nick' => 'friendcontact',
161 'nurl' => 'http://localhost/profile/friendcontact',
162 'url' => 'http://localhost/profile/friendcontact',
163 'notify' => 'http://localhost/friendica/inbox',
166 'rel' => Contact::SHARING,
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',
179 'notify' => 'http://localhost/friendica/inbox',
182 'rel' => Contact::SHARING,
183 'network' => Protocol::DFRN,
184 'location' => 'DFRN',
190 'name' => 'Mutual contact',
191 'nick' => 'mutualcontact',
193 'nurl' => 'http://localhost/profile/mutualcontact',
194 'url' => 'http://localhost/profile/mutualcontact',
195 'notify' => 'http://localhost/friendica/inbox',
198 'rel' => Contact::FRIEND,
199 'network' => Protocol::DFRN,
200 'location' => 'DFRN',
206 'name' => 'Mutual contact',
207 'nick' => 'mutualcontact',
209 'nurl' => 'http://localhost/profile/mutualcontact',
210 'url' => 'http://localhost/profile/mutualcontact',
211 'notify' => 'http://localhost/friendica/inbox',
214 'rel' => Contact::SHARING,
215 'network' => Protocol::DFRN,
216 'location' => 'DFRN',
222 'name' => 'Self contact',
223 'nick' => 'selfcontact',
225 'nurl' => 'http://localhost/profile/selfcontact',
226 'url' => 'http://localhost/profile/selfcontact',
227 'notify' => 'http://localhost/friendica/inbox',
228 'about' => 'User used in tests',
231 'rel' => Contact::FOLLOWER,
232 'network' => Protocol::DFRN,
233 'location' => 'DFRN',
238 "url" => "http://localhost/profile/selfcontact",
242 "following" => "http://localhost/following/selfcontact",
243 "followers" => "http://localhost/followers/selfcontact",
244 "inbox" => "http://localhost/inbox/selfcontact",
245 "outbox" => "http://localhost/outbox/selfcontact",
246 "sharedinbox" => "http://localhost/inbox",
247 "manually-approve" => 1,
249 "nick" => "selfcontact",
250 "name" => "Self contact",
251 "about" => "User used in tests",
254 "photo" => "http://localhost/photo/profile/admin.jpeg",
256 "addr" => "selfcontact@localhost",
258 "pubkey" => "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVqxF9kIgtgRL0+q+jTi578FA1\nr1+crEmlYc0pdxcbmmrhjuRcrK1gX3r0mnP25fkHzG+6CAjgbDBRFM1/RXBCyp/K\nHVks7eQ4yr4MxTRlsxo5qf2onbyNzM7Q+LZhFhe/yIoGN/fuEjlqBE98IfPOrUjs\nQPX240vGNXIkfLiAWwIDAQAB\n-----END PUBLIC KEY-----",
259 "subscribe" => "/follow?url={uri}",
262 "generator" => "Friendica 'Siberian Iris' 2021.12-dev-1443",
263 "following_count" => 0,
264 "followers_count" => 0,
265 "statuses_count" => 0,
266 "updated" => "2021-11-19 19:17:59",
276 'name' => 'http://activitystrea.ms/schema/1.0/like',
280 'name' => 'http://purl.org/macgirvin/dfrn/1.0/dislike',
284 'name' => 'http://purl.org/zot/activity/attendyes',
288 'name' => 'http://purl.org/zot/activity/attendno',
292 'name' => 'http://purl.org/zot/activity/attendmaybe',
296 'name' => 'http://activitystrea.ms/schema/1.0/follow',
300 'name' => 'https://www.w3.org/ns/activitystreams#Announce',
304 'name' => 'http://activitystrea.ms/schema/1.0/post',
310 'body' => 'Parent status',
311 'plink' => 'http://localhost/display/1',
316 'plink' => 'http://localhost/display/2',
320 'body' => 'Other user status',
321 'plink' => 'http://localhost/display/3',
325 'body' => 'Friend user reply',
326 'plink' => 'http://localhost/display/4',
330 'body' => '[share]Shared status[/share]',
331 'plink' => 'http://localhost/display/5',
335 'body' => 'Friend user status',
336 'plink' => 'http://localhost/display/6',
340 'title' => 'item_title',
341 'body' => 'perspiciatis impedit voluptatem quis molestiae ea qui ' .
342 'reiciendis dolorum aut ducimus sunt consequatur inventore dolor ' .
343 'officiis pariatur doloremque nemo culpa aut quidem qui dolore ' .
344 'laudantium atque commodi alias voluptatem non possimus aperiam ' .
345 'ipsum rerum consequuntur aut amet fugit quia aliquid praesentium ' .
346 'repellendus quibusdam et et inventore mollitia rerum sit autem ' .
347 'pariatur maiores ipsum accusantium perferendis vel sit possimus ' .
348 'veritatis nihil distinctio qui eum repellat officia illum quos ' .
349 'impedit quam iste esse unde qui suscipit aut facilis ut inventore ' .
350 'omnis exercitationem quo magnam consequatur maxime aut illum ' .
351 'soluta quaerat natus unde aspernatur et sed beatae nihil ullam ' .
352 'temporibus corporis ratione blanditiis perspiciatis impedit ' .
353 'voluptatem quis molestiae ea qui reiciendis dolorum aut ducimus ' .
354 'sunt consequatur inventore dolor officiis pariatur doloremque ' .
355 'nemo culpa aut quidem qui dolore laudantium atque commodi alias ' .
356 'voluptatem non possimus aperiam ipsum rerum consequuntur aut ' .
357 'amet fugit quia aliquid praesentium repellendus quibusdam et et ' .
358 'inventore mollitia rerum sit autem pariatur maiores ipsum accusantium ' .
359 'perferendis vel sit possimus veritatis nihil distinctio qui eum ' .
360 'repellat officia illum quos impedit quam iste esse unde qui ' .
361 'suscipit aut facilis ut inventore omnis exercitationem quo magnam ' .
362 'consequatur maxime aut illum soluta quaerat natus unde aspernatur ' .
363 'et sed beatae nihil ullam temporibus corporis ratione blanditiis',
364 'plink' => 'http://localhost/display/6',
370 'parent-uri-id' => 1,
371 'thr-parent-id' => 1,
372 'gravity' => Item::GRAVITY_PARENT,
373 'network' => Protocol::DFRN,
378 'private' => Item::PUBLIC,
385 'parent-uri-id' => 1,
386 'thr-parent-id' => 1,
387 'gravity' => Item::GRAVITY_COMMENT,
388 'network' => Protocol::DFRN,
393 'private' => Item::PUBLIC,
400 'parent-uri-id' => 3,
401 'thr-parent-id' => 3,
402 'gravity' => Item::GRAVITY_PARENT,
403 'network' => Protocol::DFRN,
408 'private' => Item::PUBLIC,
415 'parent-uri-id' => 1,
416 'thr-parent-id' => 1,
417 'gravity' => Item::GRAVITY_COMMENT,
418 'network' => Protocol::DFRN,
423 'private' => Item::PUBLIC,
430 'parent-uri-id' => 1,
431 'thr-parent-id' => 1,
432 'gravity' => Item::GRAVITY_COMMENT,
433 'network' => Protocol::DFRN,
438 'private' => Item::PUBLIC,
445 'parent-uri-id' => 6,
446 'thr-parent-id' => 6,
447 'gravity' => Item::GRAVITY_PARENT,
448 'network' => Protocol::DFRN,
453 'private' => Item::PUBLIC,
460 'parent-uri-id' => 7,
461 'thr-parent-id' => 7,
462 'gravity' => Item::GRAVITY_PARENT,
463 'network' => Protocol::DFRN,
468 'private' => Item::PUBLIC,
486 'parent-uri-id' => 1,
487 'thr-parent-id' => 1,
488 'private' => Item::PUBLIC,
490 'gravity' => Item::GRAVITY_PARENT,
491 'network' => Protocol::DFRN,
502 'parent-uri-id' => 1,
503 'thr-parent-id' => 1,
504 'gravity' => Item::GRAVITY_COMMENT,
505 'network' => Protocol::DFRN,
510 'private' => Item::PUBLIC,
523 'parent-uri-id' => 3,
524 'thr-parent-id' => 3,
525 'gravity' => Item::GRAVITY_PARENT,
526 'network' => Protocol::DFRN,
531 'private' => Item::PUBLIC,
544 'parent-uri-id' => 1,
545 'thr-parent-id' => 1,
546 'gravity' => Item::GRAVITY_COMMENT,
547 'network' => Protocol::DFRN,
552 'private' => Item::PUBLIC,
565 'parent-uri-id' => 1,
566 'thr-parent-id' => 1,
567 'gravity' => Item::GRAVITY_COMMENT,
568 'network' => Protocol::DFRN,
573 'private' => Item::PUBLIC,
586 'parent-uri-id' => 6,
587 'thr-parent-id' => 6,
588 'gravity' => Item::GRAVITY_PARENT,
589 'network' => Protocol::DFRN,
594 'private' => Item::PUBLIC,
607 'parent-uri-id' => 1,
608 'thr-parent-id' => 1,
609 'gravity' => Item::GRAVITY_PARENT,
610 'network' => Protocol::DFRN,
615 'private' => Item::PUBLIC,
628 'parent-uri-id' => 1,
629 'thr-parent-id' => 1,
630 'gravity' => Item::GRAVITY_COMMENT,
631 'network' => Protocol::DFRN,
636 'private' => Item::PUBLIC,
649 'parent-uri-id' => 3,
650 'thr-parent-id' => 3,
651 'gravity' => Item::GRAVITY_PARENT,
652 'network' => Protocol::DFRN,
657 'private' => Item::PUBLIC,
670 'parent-uri-id' => 1,
671 'thr-parent-id' => 1,
672 'gravity' => Item::GRAVITY_COMMENT,
673 'network' => Protocol::DFRN,
678 'private' => Item::PUBLIC,
691 'parent-uri-id' => 1,
692 'thr-parent-id' => 1,
693 'gravity' => Item::GRAVITY_COMMENT,
694 'network' => Protocol::DFRN,
699 'private' => Item::PUBLIC,
716 'parent-uri-id' => 6,
717 'thr-parent-id' => 6,
718 'private' => Item::PUBLIC,
720 'gravity' => Item::GRAVITY_PARENT,
721 'network' => Protocol::DFRN,
737 'parent-uri-id' => 7,
738 'thr-parent-id' => 7,
739 'private' => Item::PUBLIC,
741 'gravity' => Item::GRAVITY_PARENT,
742 'network' => Protocol::DFRN,
754 'network' => Protocol::DFRN,
761 'network' => Protocol::DFRN,
768 'network' => Protocol::DFRN,
775 'network' => Protocol::DFRN,
778 'post-thread-user' => [
788 'network' => Protocol::DFRN,
801 'network' => Protocol::DFRN,
814 'network' => Protocol::DFRN,
827 'network' => Protocol::DFRN,
840 'network' => Protocol::DFRN,
848 'post-user-id' => 12,
853 'network' => Protocol::DFRN,
866 'network' => Protocol::DFRN,
874 'post-user-id' => 12,
879 'network' => Protocol::DFRN,
888 'name' => 'Friend contact',
889 'url' => 'http://localhost/profile/friendcontact',
890 'photo' => 'http://localhost/',
891 'date' => '2020-01-01 12:12:02',
892 'msg' => 'A test reply from an item',
894 'link' => 'http://localhost/display/1',
897 'verb' => \Friendica\Protocol\Activity::POST,
898 'otype' => Notification\ObjectType::ITEM,
899 'name_cache' => 'Friend contact',
900 'msg_cache' => 'A test reply from an item',
914 'name' => 'Visible list',
920 'name' => 'Private list',
943 'term' => 'Saved search',