Changeset 45508 for branches/5.2/tests/phpunit/tests/user/capabilities.php
- Timestamp:
- 06/10/2019 07:49:27 AM (5 years ago)
- Location:
- branches/5.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2
-
branches/5.2/tests/phpunit/tests/user/capabilities.php
r44973 r45508 77 77 return array( 78 78 79 'unfiltered_html' => array( 'administrator', 'editor' ), 80 81 'activate_plugins' => array( 'administrator' ), 82 'create_users' => array( 'administrator' ), 83 'delete_plugins' => array( 'administrator' ), 84 'delete_themes' => array( 'administrator' ), 85 'delete_users' => array( 'administrator' ), 86 'edit_files' => array( 'administrator' ), 87 'edit_plugins' => array( 'administrator' ), 88 'edit_themes' => array( 'administrator' ), 89 'edit_users' => array( 'administrator' ), 90 'install_plugins' => array( 'administrator' ), 91 'install_themes' => array( 'administrator' ), 92 'update_core' => array( 'administrator' ), 93 'update_plugins' => array( 'administrator' ), 94 'update_themes' => array( 'administrator' ), 95 'edit_theme_options' => array( 'administrator' ), 96 'export' => array( 'administrator' ), 97 'import' => array( 'administrator' ), 98 'list_users' => array( 'administrator' ), 99 'manage_options' => array( 'administrator' ), 100 'promote_users' => array( 'administrator' ), 101 'remove_users' => array( 'administrator' ), 102 'switch_themes' => array( 'administrator' ), 103 'edit_dashboard' => array( 'administrator' ), 104 'resume_plugins' => array( 'administrator' ), 105 'resume_themes' => array( 'administrator' ), 106 107 'moderate_comments' => array( 'administrator', 'editor' ), 108 'manage_categories' => array( 'administrator', 'editor' ), 109 'edit_others_posts' => array( 'administrator', 'editor' ), 110 'edit_pages' => array( 'administrator', 'editor' ), 111 'edit_others_pages' => array( 'administrator', 'editor' ), 112 'edit_published_pages' => array( 'administrator', 'editor' ), 113 'publish_pages' => array( 'administrator', 'editor' ), 114 'delete_pages' => array( 'administrator', 'editor' ), 115 'delete_others_pages' => array( 'administrator', 'editor' ), 116 'delete_published_pages' => array( 'administrator', 'editor' ), 117 'delete_others_posts' => array( 'administrator', 'editor' ), 118 'delete_private_posts' => array( 'administrator', 'editor' ), 119 'edit_private_posts' => array( 'administrator', 'editor' ), 120 'read_private_posts' => array( 'administrator', 'editor' ), 121 'delete_private_pages' => array( 'administrator', 'editor' ), 122 'edit_private_pages' => array( 'administrator', 'editor' ), 123 'read_private_pages' => array( 'administrator', 'editor' ), 124 125 'edit_published_posts' => array( 'administrator', 'editor', 'author' ), 126 'upload_files' => array( 'administrator', 'editor', 'author' ), 127 'publish_posts' => array( 'administrator', 'editor', 'author' ), 128 'delete_published_posts' => array( 'administrator', 'editor', 'author' ), 129 130 'edit_posts' => array( 'administrator', 'editor', 'author', 'contributor' ), 131 'delete_posts' => array( 'administrator', 'editor', 'author', 'contributor' ), 132 133 'read' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ), 134 135 'level_10' => array( 'administrator' ), 136 'level_9' => array( 'administrator' ), 137 'level_8' => array( 'administrator' ), 138 'level_7' => array( 'administrator', 'editor' ), 139 'level_6' => array( 'administrator', 'editor' ), 140 'level_5' => array( 'administrator', 'editor' ), 141 'level_4' => array( 'administrator', 'editor' ), 142 'level_3' => array( 'administrator', 'editor' ), 143 'level_2' => array( 'administrator', 'editor', 'author' ), 144 'level_1' => array( 'administrator', 'editor', 'author', 'contributor' ), 145 'level_0' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ), 146 147 'administrator' => array( 'administrator' ), 148 'editor' => array( 'editor' ), 149 'author' => array( 'author' ), 150 'contributor' => array( 'contributor' ), 151 'subscriber' => array( 'subscriber' ), 79 'unfiltered_html' => array( 'administrator', 'editor' ), 80 81 'activate_plugins' => array( 'administrator' ), 82 'create_users' => array( 'administrator' ), 83 'delete_plugins' => array( 'administrator' ), 84 'delete_themes' => array( 'administrator' ), 85 'delete_users' => array( 'administrator' ), 86 'edit_files' => array( 'administrator' ), 87 'edit_plugins' => array( 'administrator' ), 88 'edit_themes' => array( 'administrator' ), 89 'edit_users' => array( 'administrator' ), 90 'install_plugins' => array( 'administrator' ), 91 'install_themes' => array( 'administrator' ), 92 'update_core' => array( 'administrator' ), 93 'update_plugins' => array( 'administrator' ), 94 'update_themes' => array( 'administrator' ), 95 'edit_theme_options' => array( 'administrator' ), 96 'export' => array( 'administrator' ), 97 'import' => array( 'administrator' ), 98 'list_users' => array( 'administrator' ), 99 'manage_options' => array( 'administrator' ), 100 'promote_users' => array( 'administrator' ), 101 'remove_users' => array( 'administrator' ), 102 'switch_themes' => array( 'administrator' ), 103 'edit_dashboard' => array( 'administrator' ), 104 'resume_plugins' => array( 'administrator' ), 105 'resume_themes' => array( 'administrator' ), 106 'view_site_health_checks' => array( 'administrator' ), 107 108 'moderate_comments' => array( 'administrator', 'editor' ), 109 'manage_categories' => array( 'administrator', 'editor' ), 110 'edit_others_posts' => array( 'administrator', 'editor' ), 111 'edit_pages' => array( 'administrator', 'editor' ), 112 'edit_others_pages' => array( 'administrator', 'editor' ), 113 'edit_published_pages' => array( 'administrator', 'editor' ), 114 'publish_pages' => array( 'administrator', 'editor' ), 115 'delete_pages' => array( 'administrator', 'editor' ), 116 'delete_others_pages' => array( 'administrator', 'editor' ), 117 'delete_published_pages' => array( 'administrator', 'editor' ), 118 'delete_others_posts' => array( 'administrator', 'editor' ), 119 'delete_private_posts' => array( 'administrator', 'editor' ), 120 'edit_private_posts' => array( 'administrator', 'editor' ), 121 'read_private_posts' => array( 'administrator', 'editor' ), 122 'delete_private_pages' => array( 'administrator', 'editor' ), 123 'edit_private_pages' => array( 'administrator', 'editor' ), 124 'read_private_pages' => array( 'administrator', 'editor' ), 125 126 'edit_published_posts' => array( 'administrator', 'editor', 'author' ), 127 'upload_files' => array( 'administrator', 'editor', 'author' ), 128 'publish_posts' => array( 'administrator', 'editor', 'author' ), 129 'delete_published_posts' => array( 'administrator', 'editor', 'author' ), 130 131 'edit_posts' => array( 'administrator', 'editor', 'author', 'contributor' ), 132 'delete_posts' => array( 'administrator', 'editor', 'author', 'contributor' ), 133 134 'read' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ), 135 136 'level_10' => array( 'administrator' ), 137 'level_9' => array( 'administrator' ), 138 'level_8' => array( 'administrator' ), 139 'level_7' => array( 'administrator', 'editor' ), 140 'level_6' => array( 'administrator', 'editor' ), 141 'level_5' => array( 'administrator', 'editor' ), 142 'level_4' => array( 'administrator', 'editor' ), 143 'level_3' => array( 'administrator', 'editor' ), 144 'level_2' => array( 'administrator', 'editor', 'author' ), 145 'level_1' => array( 'administrator', 'editor', 'author', 'contributor' ), 146 'level_0' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ), 147 148 'administrator' => array( 'administrator' ), 149 'editor' => array( 'editor' ), 150 'author' => array( 'author' ), 151 'contributor' => array( 'contributor' ), 152 'subscriber' => array( 'subscriber' ), 152 153 153 154 ); … … 158 159 return array( 159 160 160 'unfiltered_html' => array(), 161 162 'activate_plugins' => array(), 163 'create_users' => array(), 164 'delete_plugins' => array(), 165 'delete_themes' => array(), 166 'delete_users' => array(), 167 'edit_files' => array(), 168 'edit_plugins' => array(), 169 'edit_themes' => array(), 170 'edit_users' => array(), 171 'install_plugins' => array(), 172 'install_themes' => array(), 173 'update_core' => array(), 174 'update_plugins' => array(), 175 'update_themes' => array(), 176 177 'edit_theme_options' => array( 'administrator' ), 178 'export' => array( 'administrator' ), 179 'import' => array( 'administrator' ), 180 'list_users' => array( 'administrator' ), 181 'manage_options' => array( 'administrator' ), 182 'promote_users' => array( 'administrator' ), 183 'remove_users' => array( 'administrator' ), 184 'switch_themes' => array( 'administrator' ), 185 'edit_dashboard' => array( 'administrator' ), 186 'resume_plugins' => array( 'administrator' ), 187 'resume_themes' => array( 'administrator' ), 188 189 'moderate_comments' => array( 'administrator', 'editor' ), 190 'manage_categories' => array( 'administrator', 'editor' ), 191 'edit_others_posts' => array( 'administrator', 'editor' ), 192 'edit_pages' => array( 'administrator', 'editor' ), 193 'edit_others_pages' => array( 'administrator', 'editor' ), 194 'edit_published_pages' => array( 'administrator', 'editor' ), 195 'publish_pages' => array( 'administrator', 'editor' ), 196 'delete_pages' => array( 'administrator', 'editor' ), 197 'delete_others_pages' => array( 'administrator', 'editor' ), 198 'delete_published_pages' => array( 'administrator', 'editor' ), 199 'delete_others_posts' => array( 'administrator', 'editor' ), 200 'delete_private_posts' => array( 'administrator', 'editor' ), 201 'edit_private_posts' => array( 'administrator', 'editor' ), 202 'read_private_posts' => array( 'administrator', 'editor' ), 203 'delete_private_pages' => array( 'administrator', 'editor' ), 204 'edit_private_pages' => array( 'administrator', 'editor' ), 205 'read_private_pages' => array( 'administrator', 'editor' ), 206 207 'edit_published_posts' => array( 'administrator', 'editor', 'author' ), 208 'upload_files' => array( 'administrator', 'editor', 'author' ), 209 'publish_posts' => array( 'administrator', 'editor', 'author' ), 210 'delete_published_posts' => array( 'administrator', 'editor', 'author' ), 211 212 'edit_posts' => array( 'administrator', 'editor', 'author', 'contributor' ), 213 'delete_posts' => array( 'administrator', 'editor', 'author', 'contributor' ), 214 215 'read' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ), 216 217 'level_10' => array( 'administrator' ), 218 'level_9' => array( 'administrator' ), 219 'level_8' => array( 'administrator' ), 220 'level_7' => array( 'administrator', 'editor' ), 221 'level_6' => array( 'administrator', 'editor' ), 222 'level_5' => array( 'administrator', 'editor' ), 223 'level_4' => array( 'administrator', 'editor' ), 224 'level_3' => array( 'administrator', 'editor' ), 225 'level_2' => array( 'administrator', 'editor', 'author' ), 226 'level_1' => array( 'administrator', 'editor', 'author', 'contributor' ), 227 'level_0' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ), 228 229 'administrator' => array( 'administrator' ), 230 'editor' => array( 'editor' ), 231 'author' => array( 'author' ), 232 'contributor' => array( 'contributor' ), 233 'subscriber' => array( 'subscriber' ), 161 'unfiltered_html' => array(), 162 163 'activate_plugins' => array(), 164 'create_users' => array(), 165 'delete_plugins' => array(), 166 'delete_themes' => array(), 167 'delete_users' => array(), 168 'edit_files' => array(), 169 'edit_plugins' => array(), 170 'edit_themes' => array(), 171 'edit_users' => array(), 172 'install_plugins' => array(), 173 'install_themes' => array(), 174 'update_core' => array(), 175 'update_plugins' => array(), 176 'update_themes' => array(), 177 'view_site_health_checks' => array(), 178 179 'edit_theme_options' => array( 'administrator' ), 180 'export' => array( 'administrator' ), 181 'import' => array( 'administrator' ), 182 'list_users' => array( 'administrator' ), 183 'manage_options' => array( 'administrator' ), 184 'promote_users' => array( 'administrator' ), 185 'remove_users' => array( 'administrator' ), 186 'switch_themes' => array( 'administrator' ), 187 'edit_dashboard' => array( 'administrator' ), 188 'resume_plugins' => array( 'administrator' ), 189 'resume_themes' => array( 'administrator' ), 190 191 'moderate_comments' => array( 'administrator', 'editor' ), 192 'manage_categories' => array( 'administrator', 'editor' ), 193 'edit_others_posts' => array( 'administrator', 'editor' ), 194 'edit_pages' => array( 'administrator', 'editor' ), 195 'edit_others_pages' => array( 'administrator', 'editor' ), 196 'edit_published_pages' => array( 'administrator', 'editor' ), 197 'publish_pages' => array( 'administrator', 'editor' ), 198 'delete_pages' => array( 'administrator', 'editor' ), 199 'delete_others_pages' => array( 'administrator', 'editor' ), 200 'delete_published_pages' => array( 'administrator', 'editor' ), 201 'delete_others_posts' => array( 'administrator', 'editor' ), 202 'delete_private_posts' => array( 'administrator', 'editor' ), 203 'edit_private_posts' => array( 'administrator', 'editor' ), 204 'read_private_posts' => array( 'administrator', 'editor' ), 205 'delete_private_pages' => array( 'administrator', 'editor' ), 206 'edit_private_pages' => array( 'administrator', 'editor' ), 207 'read_private_pages' => array( 'administrator', 'editor' ), 208 209 'edit_published_posts' => array( 'administrator', 'editor', 'author' ), 210 'upload_files' => array( 'administrator', 'editor', 'author' ), 211 'publish_posts' => array( 'administrator', 'editor', 'author' ), 212 'delete_published_posts' => array( 'administrator', 'editor', 'author' ), 213 214 'edit_posts' => array( 'administrator', 'editor', 'author', 'contributor' ), 215 'delete_posts' => array( 'administrator', 'editor', 'author', 'contributor' ), 216 217 'read' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ), 218 219 'level_10' => array( 'administrator' ), 220 'level_9' => array( 'administrator' ), 221 'level_8' => array( 'administrator' ), 222 'level_7' => array( 'administrator', 'editor' ), 223 'level_6' => array( 'administrator', 'editor' ), 224 'level_5' => array( 'administrator', 'editor' ), 225 'level_4' => array( 'administrator', 'editor' ), 226 'level_3' => array( 'administrator', 'editor' ), 227 'level_2' => array( 'administrator', 'editor', 'author' ), 228 'level_1' => array( 'administrator', 'editor', 'author', 'contributor' ), 229 'level_0' => array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ), 230 231 'administrator' => array( 'administrator' ), 232 'editor' => array( 'editor' ), 233 'author' => array( 'author' ), 234 'contributor' => array( 'contributor' ), 235 'subscriber' => array( 'subscriber' ), 234 236 235 237 ); … … 398 400 $actual['subscriber'], 399 401 $actual['contributor'], 400 // the following twoare granted via `user_has_cap`:402 // The following are granted via `user_has_cap`: 401 403 $actual['resume_plugins'], 402 $actual['resume_themes'] 404 $actual['resume_themes'], 405 $actual['view_site_health_checks'] 403 406 ); 404 407 … … 1201 1204 $this->assertFalse( $contributor->has_cap( 'edit_post', $post ) ); 1202 1205 $this->assertFalse( $contributor->has_cap( 'delete_post', $post ) ); 1203 $this->assertEquals( $status === 'publish', $contributor->has_cap( 'read_post', $post ) );1206 $this->assertEquals( 'publish' === $status, $contributor->has_cap( 'read_post', $post ) ); 1204 1207 } 1205 1208
Note: See TracChangeset
for help on using the changeset viewer.