Changeset 45607 for trunk/tests/phpunit/tests/user.php
- Timestamp:
- 07/08/2019 12:55:20 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/user.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user.php
r45588 r45607 82 82 foreach ( $user_list as $user ) { 83 83 // only include the users we just created - there might be some others that existed previously 84 if ( in_array( $user->ID, $nusers ) ) {84 if ( in_array( $user->ID, $nusers, true ) ) { 85 85 $found[] = $user->ID; 86 86 } … … 162 162 // so we'll just check to make sure our values are included somewhere. 163 163 foreach ( $vals as $k => $v ) { 164 $this->assertTrue( isset( $out[ $k ] ) && $out[ $k ][0] == $v );164 $this->assertTrue( isset( $out[ $k ] ) && $out[ $k ][0] === $v ); 165 165 } 166 166 // delete one key and check again … … 171 171 // make sure that key is excluded from the results 172 172 foreach ( $vals as $k => $v ) { 173 if ( $k == $key_to_delete ) {173 if ( $k === $key_to_delete ) { 174 174 $this->assertFalse( isset( $out[ $k ] ) ); 175 175 } else { 176 $this->assertTrue( isset( $out[ $k ] ) && $out[ $k ][0] == $v );176 $this->assertTrue( isset( $out[ $k ] ) && $out[ $k ][0] === $v ); 177 177 } 178 178 } … … 600 600 } 601 601 602 @update_user_meta( $id2, 'key', 'value' );602 update_user_meta( $id2, 'key', 'value' ); 603 603 604 604 $metas = array_keys( get_user_meta( 1 ) ); … … 1023 1023 ); 1024 1024 1025 $this->assertTrue( in_array( self::$contrib_id, $users) );1025 $this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) ); 1026 1026 } 1027 1027 … … 1034 1034 ); 1035 1035 1036 $this->assertTrue( in_array( self::$contrib_id, $users) );1036 $this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) ); 1037 1037 } 1038 1038 … … 1045 1045 ); 1046 1046 1047 $this->assertTrue( in_array( self::$contrib_id, $users) );1047 $this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) ); 1048 1048 } 1049 1049 … … 1056 1056 ); 1057 1057 1058 $this->assertTrue( in_array( self::$contrib_id, $users) );1058 $this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) ); 1059 1059 } 1060 1060 … … 1067 1067 ); 1068 1068 1069 $this->assertTrue( in_array( self::$contrib_id, $users) );1069 $this->assertTrue( in_array( (string) self::$contrib_id, $users, true ) ); 1070 1070 } 1071 1071 … … 1202 1202 */ 1203 1203 if ( ! empty( $GLOBALS['phpmailer']->mock_sent ) ) { 1204 $was_admin_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && WP_TESTS_EMAIL == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] );1205 $was_user_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[1] ) && 'blackburn@battlefield3.com' == $GLOBALS['phpmailer']->mock_sent[1]['to'][0][0] );1204 $was_admin_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && WP_TESTS_EMAIL === $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] ); 1205 $was_user_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[1] ) && 'blackburn@battlefield3.com' === $GLOBALS['phpmailer']->mock_sent[1]['to'][0][0] ); 1206 1206 } 1207 1207 … … 1227 1227 */ 1228 1228 if ( ! empty( $GLOBALS['phpmailer']->mock_sent ) ) { 1229 $was_admin_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && WP_TESTS_EMAIL == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] );1230 $was_user_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[1] ) && 'blackburn@battlefield3.com' == $GLOBALS['phpmailer']->mock_sent[1]['to'][0][0] );1229 $was_admin_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && WP_TESTS_EMAIL === $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] ); 1230 $was_user_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[1] ) && 'blackburn@battlefield3.com' === $GLOBALS['phpmailer']->mock_sent[1]['to'][0][0] ); 1231 1231 } 1232 1232 … … 1466 1466 1467 1467 if ( ! empty( $GLOBALS['phpmailer']->mock_sent ) ) { 1468 $was_confirmation_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && 'after@example.com' == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] );1468 $was_confirmation_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && 'after@example.com' === $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] ); 1469 1469 } 1470 1470 … … 1503 1503 1504 1504 if ( ! empty( $GLOBALS['phpmailer']->mock_sent ) ) { 1505 $was_confirmation_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && 'after@example.com' == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] );1505 $was_confirmation_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && 'after@example.com' === $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] ); 1506 1506 } 1507 1507
Note: See TracChangeset
for help on using the changeset viewer.