-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCreateUserTest.php
More file actions
136 lines (126 loc) · 2.93 KB
/
CreateUserTest.php
File metadata and controls
136 lines (126 loc) · 2.93 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
<?php
/**
* User::createUser()のテスト
*
* @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
*/
App::uses('NetCommonsModelTestCase', 'NetCommons.TestSuite');
/**
* User::createUser()のテスト
*
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @package NetCommons\Users\Test\Case\Model\User
*/
class UserCreateUserTest extends NetCommonsModelTestCase {
/**
* Fixtures
*
* @var array
*/
public $fixtures = array(
'plugin.users.user',
'plugin.users.user_select_count',
'plugin.users.users_language',
);
/**
* Plugin name
*
* @var string
*/
public $plugin = 'users';
/**
* Model name
*
* @var string
*/
protected $_modelName = 'User';
/**
* Method name
*
* @var string
*/
protected $_methodName = 'createUser';
/**
* createUser()のテスト
*
* @return void
*/
public function testCreateUser() {
$model = $this->_modelName;
$methodName = $this->_methodName;
//テスト実施
$result = $this->$model->$methodName();
//チェック
$expected = array(
'UsersLanguage' => array(
0 => array(
'user_id' => '',
'language_id' => 1,
'name' => null,
'profile' => null,
'search_keywords' => null,
'id' => null,
),
1 => array(
'user_id' => '',
'language_id' => 2,
'name' => null,
'profile' => null,
'search_keywords' => null,
'id' => null,
),
),
'User' => array(
'is_deleted' => '0',
'is_avatar_public' => '0',
'is_avatar_auto_created' => '1',
'is_handlename_public' => '0',
'is_name_public' => '0',
'is_email_public' => '0',
'is_email_reception' => '1',
'is_moblie_mail_public' => '0',
'is_moblie_mail_reception' => '1',
'is_sex_public' => '0',
'is_language_public' => '0',
'is_timezone_public' => '0',
'is_role_key_public' => '0',
'is_status_public' => '0',
'is_created_public' => '0',
'created_user' => '0',
'is_created_user_public' => '0',
'is_modified_public' => '0',
'modified_user' => '0',
'is_modified_user_public' => '0',
'is_password_modified_public' => '0',
'is_last_login_public' => '0',
'is_previous_login_public' => '0',
'is_profile_public' => '0',
'is_search_keywords_public' => '0',
'username' => '',
'password' => null,
'key' => null,
'activate_key' => null,
'activated' => null,
'handlename' => null,
'email' => null,
'moblie_mail' => null,
'sex' => null,
'language' => 'auto',
'timezone' => 'Asia/Tokyo',
'role_key' => 'common_user',
'status' => null,
'created' => null,
'modified' => null,
'password_modified' => null,
'last_login' => null,
'previous_login' => null,
'id' => null,
),
);
$this->assertEquals($result, $expected);
}
}