Code Duplication    Length = 19-19 lines in 2 locations

tests/phpunit/tests/user.php 2 locations

@@ 1096-1114 (lines=19) @@
1093
	 * @ticket 33654
1094
	 * @expectedDeprecated wp_new_user_notification
1095
	 */
1096
	function test_wp_new_user_notification_old_signature_throws_deprecated_warning_but_sends() {
1097
		reset_phpmailer_instance();
1098
1099
		$was_admin_email_sent = false;
1100
		$was_user_email_sent = false;
1101
		wp_new_user_notification( self::$contrib_id, 'this_is_a_test_password' );
1102
1103
		/*
1104
		 * Check to see if a notification email was sent to the
1105
		 * post author `[email protected]` and and site admin `[email protected]`.
1106
		 */
1107
		if ( ! empty( $GLOBALS['phpmailer']->mock_sent ) ) {
1108
			$was_admin_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && WP_TESTS_EMAIL == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] );
1109
			$was_user_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[1] ) && '[email protected]' == $GLOBALS['phpmailer']->mock_sent[1]['to'][0][0] );
1110
		}
1111
1112
		$this->assertTrue( $was_admin_email_sent );
1113
		$this->assertTrue( $was_user_email_sent );
1114
	}
1115
1116
	/**
1117
	 * Set up a user and try sending a notification using `wp_new_user_notification( $user );`.
@@ 1121-1139 (lines=19) @@
1118
	 *
1119
	 * @ticket 34377
1120
	 */
1121
	function test_wp_new_user_notification_old_signature_no_password() {
1122
		reset_phpmailer_instance();
1123
1124
		$was_admin_email_sent = false;
1125
		$was_user_email_sent = false;
1126
		wp_new_user_notification( self::$contrib_id );
1127
1128
		/*
1129
		 * Check to see if a notification email was sent to the
1130
		 * post author `[email protected]` and and site admin `[email protected]`.
1131
		 */
1132
		if ( ! empty( $GLOBALS['phpmailer']->mock_sent ) ) {
1133
			$was_admin_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && WP_TESTS_EMAIL == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] );
1134
			$was_user_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[1] ) && '[email protected]' == $GLOBALS['phpmailer']->mock_sent[1]['to'][0][0] );
1135
		}
1136
1137
		$this->assertTrue( $was_admin_email_sent );
1138
		$this->assertFalse( $was_user_email_sent );
1139
	}
1140
1141
	/**
1142
	 * Checks that calling edit_user() with no password returns an error when adding, and doesn't when updating.