-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLinkFixture.php
More file actions
164 lines (160 loc) · 3.97 KB
/
LinkFixture.php
File metadata and controls
164 lines (160 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
/**
* Link Fixture
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
/**
* Link Fixture
*
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @package NetCommons\Links\Test\Fixture
*/
class LinkFixture extends CakeTestFixture {
/**
* Records
*
* @var array
*/
public $records = array(
// * ルーム管理者が書いたコンテンツ&一度公開して、下書き中
array(
'id' => '1',
'block_id' => '2',
'key' => 'content_key_1',
'language_id' => '2',
'category_id' => '1',
'status' => '1',
'is_active' => true,
'is_latest' => false,
'url' => 'http://www.netcommons.org',
'title' => 'Title 1',
'description' => 'Description 1',
'click_count' => '1',
'created_user' => '1'
),
array(
'id' => '2',
'block_id' => '2',
'key' => 'content_key_1',
'language_id' => '2',
'category_id' => '1',
'status' => '3',
'is_active' => false,
'is_latest' => true,
'url' => 'http://www.netcommons.org',
'title' => 'Title 2',
'description' => 'Description 2',
'click_count' => '1',
'created_user' => '1'
),
// * 一般が書いたコンテンツ&一度も公開していない(承認待ち)
array(
'id' => '3',
'block_id' => '2',
'key' => 'content_key_2',
'language_id' => '2',
'category_id' => '1',
'status' => '2',
'is_active' => false,
'is_latest' => true,
'url' => 'http://www.netcommons.org',
'title' => 'Title 3',
'description' => 'Description 3',
'click_count' => '1',
'created_user' => '4'
),
// * 一般が書いたコンテンツ&公開して、一時保存
array(
'id' => '4',
'block_id' => '2',
'key' => 'content_key_3',
'language_id' => '2',
'category_id' => null,
'status' => '1',
'is_active' => true,
'is_latest' => false,
'url' => 'http://www.netcommons.org',
'title' => 'Title 4',
'description' => 'Description 4',
'click_count' => '1',
'created_user' => '4'
),
array(
'id' => '5',
'block_id' => '2',
'key' => 'content_key_3',
'language_id' => '2',
'category_id' => null,
'status' => '3',
'is_active' => false,
'is_latest' => true,
'url' => 'http://www.netcommons.org',
'title' => 'Title 5',
'description' => 'Description 5',
'click_count' => '1',
'created_user' => '4'
),
// * 編集者が書いたコンテンツ&一度公開して、差し戻し
array(
'id' => '6',
'block_id' => '2',
'key' => 'content_key_4',
'language_id' => '2',
'category_id' => '1',
'status' => '1',
'is_active' => true,
'is_latest' => false,
'url' => 'http://www.netcommons.org',
'title' => 'Title 6',
'description' => 'Description 6',
'click_count' => '1',
'created_user' => '3'
),
array(
'id' => '7',
'block_id' => '2',
'key' => 'content_key_4',
'language_id' => '2',
'category_id' => '1',
'status' => '4',
'is_active' => false,
'is_latest' => true,
'url' => 'http://www.netcommons.org',
'title' => 'Title 7',
'description' => 'Description 7',
'click_count' => '1',
'created_user' => '3'
),
// * 編集長が書いたコンテンツ&一度も公開していない(下書き中)
array(
'id' => '8',
'block_id' => '2',
'key' => 'content_key_5',
'language_id' => '2',
'category_id' => '1',
'status' => '3',
'is_active' => false,
'is_latest' => true,
'url' => 'http://www.netcommons.org',
'title' => 'Title 8',
'description' => 'Description 8',
'click_count' => '1',
'created_user' => '2'
),
);
/**
* Initialize the fixture.
*
* @return void
*/
public function init() {
require_once App::pluginPath('Links') . 'Config' . DS . 'Schema' . DS . 'schema.php';
$this->fields = (new LinksSchema())->tables[Inflector::tableize($this->name)];
parent::init();
}
}