Changeset 45588 for trunk/tests/phpunit/tests/user.php
- Timestamp:
- 07/02/2019 04:43:01 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/user.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user.php
r44645 r45588 19 19 20 20 public static function wpSetUpBeforeClass( $factory ) { 21 self::$ user_ids[] = self::$contrib_id = $factory->user->create(21 self::$contrib_id = $factory->user->create( 22 22 array( 23 23 'user_login' => 'user1', … … 34 34 ) 35 35 ); 36 37 self::$user_ids[] = self::$author_id = $factory->user->create( 36 self::$user_ids[] = self::$contrib_id; 37 38 self::$author_id = $factory->user->create( 38 39 array( 39 40 'user_login' => 'author_login', … … 42 43 ) 43 44 ); 44 45 self::$user_ids[] = self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) ); 46 self::$user_ids[] = self::$editor_id = $factory->user->create( 45 self::$user_ids[] = self::$author_id; 46 47 self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) ); 48 self::$user_ids[] = self::$admin_id; 49 self::$editor_id = $factory->user->create( 47 50 array( 48 51 'role' => 'editor', … … 50 53 ) 51 54 ); 52 self::$user_ids[] = self::$sub_id = $factory->user->create( array( 'role' => 'subscriber' ) ); 55 self::$user_ids[] = self::$editor_id; 56 self::$sub_id = $factory->user->create( array( 'role' => 'subscriber' ) ); 57 self::$user_ids[] = self::$sub_id; 53 58 54 59 self::$_author = get_user_by( 'ID', self::$author_id ); … … 1375 1380 */ 1376 1381 function test_edit_user_blank_pw() { 1377 $_POST = $_GET = $_REQUEST = array(); 1382 $_POST = array(); 1383 $_GET = array(); 1384 $_REQUEST = array(); 1378 1385 $_POST['role'] = 'subscriber'; 1379 1386 $_POST['email'] = 'user1@example.com'; … … 1391 1398 1392 1399 // Check new user with password set. 1393 $_POST['pass1'] = $_POST['pass2'] = 'password'; 1400 $_POST['pass1'] = 'password'; 1401 $_POST['pass2'] = 'password'; 1394 1402 1395 1403 $user_id = edit_user(); … … 1402 1410 // Check updating user with empty password. 1403 1411 $_POST['nickname'] = 'nickname_updated'; 1404 $_POST['pass1'] = $_POST['pass2'] = ''; 1412 $_POST['pass1'] = ''; 1413 $_POST['pass2'] = ''; 1405 1414 1406 1415 $user_id = edit_user( $user_id ); … … 1551 1560 */ 1552 1561 function test_edit_user_role_update() { 1553 $_POST = $_GET = $_REQUEST = array(); 1562 $_POST = array(); 1563 $_GET = array(); 1564 $_REQUEST = array(); 1554 1565 1555 1566 $administrator = self::factory()->user->create(
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)