]> git.mxchange.org Git - friendica.git/blob - tests/datasets/storage/database.fixture.php
Fix the tests, hopefully
[friendica.git] / tests / datasets / storage / database.fixture.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2021, the Friendica project
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 use Friendica\Core\Protocol;
23 use Friendica\Model\Contact;
24
25 return [
26         'user'    => [
27                 [
28                         'uid'      => 42,
29                         'username' => 'Test user',
30                         'nickname' => 'selfcontact',
31                         'verified' => 1,
32                         'password' => '$2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm',
33                         'theme'    => 'frio',
34                 ],
35         ],
36         'item-uri'    => [
37                 [
38                         'id'   => 42,
39                         'uri'  => 'http://localhost/profile/selfcontact',
40                         'guid' => '42',
41                 ],
42         ],
43         'contact' => [
44                 [
45                         'id'      => 42,
46                         'uid'     => 42,
47                         'uri-id'  => 42,
48                         'name'    => 'Self contact',
49                         'nick'    => 'selfcontact',
50                         'self'    => 1,
51                         'nurl'    => 'http://localhost/profile/selfcontact',
52                         'url'     => 'http://localhost/profile/selfcontact',
53                         'about'   => 'User used in tests',
54                         'pending' => 0,
55                         'blocked' => 0,
56                         'rel'     => Contact::FOLLOWER,
57                         'network' => Protocol::DFRN,
58                         'location' => 'DFRN',
59                 ],
60         ],
61         'photo'   => [
62                 // move from data-attribute to storage backend
63                 [
64                         'id'            => 1,
65                         'uid'           => 42,
66                         'contact-id'    => 42,
67                         'backend-class' => null,
68                         'backend-ref'   => 'f0c0d0i2',
69                         'data'          => 'without class',
70                 ],
71                 // move from storage-backend to maybe filesystem backend, skip at database backend
72                 [
73                         'id'            => 2,
74                         'uid'           => 42,
75                         'contact-id'    => 42,
76                         'backend-class' => 'Database',
77                         'backend-ref'   => 1,
78                         'data'          => '',
79                 ],
80                 // move data if invalid storage
81                 [
82                         'id'            => 3,
83                         'uid'           => 42,
84                         'contact-id'    => 42,
85                         'backend-class' => 'invalid!',
86                         'backend-ref'   => 'unimported',
87                         'data'          => 'invalid data moved',
88                 ],
89 // @todo Check failing test because of this (never loaded) fixture
90 //              [
91 //                      'id'            => 4,
92 //                      'uid'           => 42,
93 //                      'contact-id'    => 42,
94 //                      'backend-class' => 'invalid!',
95 //                      'backend-ref'   => 'unimported',
96 //                      'data'          => '',
97 //              ],
98         ],
99         'storage' => [
100                 [
101                         'id'   => 1,
102                         'data' => 'inside database',
103                 ],
104         ],
105 ];