- Timestamp:
- 09/13/2016 04:05:07 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/groups/class-bp-groups-group.php
r11074 r11087 1243 1243 1244 1244 /** 1245 * @ticket BP5451 1246 */ 1247 public function test_admins_property() { 1248 $user_1 = $this->factory->user->create_and_get(); 1249 $g = $this->factory->group->create( array( 1250 'creator_id' => $user_1->ID, 1251 ) ); 1252 1253 $group = new BP_Groups_Group( $g ); 1254 1255 $expected_admin_props = array( 1256 'user_id' => $user_1->ID, 1257 'user_login' => $user_1->user_login, 1258 'user_email' => $user_1->user_email, 1259 'user_nicename' => $user_1->user_nicename, 1260 'is_admin' => 1, 1261 'is_mod' => 0, 1262 ); 1263 1264 $found_admin = $group->admins[0]; 1265 foreach ( $expected_admin_props as $prop => $value ) { 1266 $this->assertEquals( $value, $found_admin->{$prop} ); 1267 } 1268 } 1269 1270 /** 1271 * @ticket BP5451 1272 */ 1273 public function test_mods_property() { 1274 $users = $this->factory->user->create_many( 2 ); 1275 $user_1 = new WP_User( $users[0] ); 1276 $user_2 = new WP_User( $users[1] ); 1277 1278 $g = $this->factory->group->create( array( 1279 'creator_id' => $user_1->ID, 1280 ) ); 1281 1282 $this->add_user_to_group( $user_2->ID, $g, array( 'is_mod' => 1 ) ); 1283 1284 $group = new BP_Groups_Group( $g ); 1285 1286 $expected_mod_props = array( 1287 'user_id' => $user_2->ID, 1288 'user_login' => $user_2->user_login, 1289 'user_email' => $user_2->user_email, 1290 'user_nicename' => $user_2->user_nicename, 1291 'is_admin' => 0, 1292 'is_mod' => 1, 1293 ); 1294 1295 $found_mod = $group->mods[0]; 1296 foreach ( $expected_mod_props as $prop => $value ) { 1297 $this->assertEquals( $value, $found_mod->{$prop} ); 1298 } 1299 } 1300 1301 /** 1245 1302 * @group group_types 1246 1303 */
Note: See TracChangeset
for help on using the changeset viewer.