/**
  * @depends test_wp_login__post_breach_threshold_verified_ip_old
  */
 public function test_wp_login__post_breach_threshold_only_notify()
 {
     self::$mail_file_basename = __METHOD__;
     $options = self::$lss->options;
     $options['login_fail_breach_pw_force_change'] = 0;
     self::$lss->options = $options;
     try {
         // Do THE deed.
         $actual = self::$lss->wp_login(null, $this->user);
     } catch (Exception $e) {
         $this->fail($e->getMessage());
     }
     $flag = login_security_solution::LOGIN_UNKNOWN_IP + login_security_solution::LOGIN_NOTIFY;
     $this->assertSame($flag + 1, $actual, 'wp_login() return value...');
     $this->assertGreaterThan(0, self::$lss->sleep, 'Sleep not set.');
     $actual = self::$lss->get_pw_force_change($this->user->ID);
     $this->assertFalse($actual, 'get_pw_force_change() return value...');
     $this->check_mail_file();
 }
Example #2
0
 /**
  * @depends test_process_login_fail__post_threshold
  */
 public function test_wp_login__post_breach_threshold_only_notify()
 {
     $options = self::$lss->options;
     $options['login_fail_breach_pw_force_change'] = 0;
     self::$lss->options = $options;
     self::$lss->delete_pw_force_change($this->user->ID);
     self::$mail_file_basename = 'LoginFailTest::test_wp_login__post_breach_threshold';
     try {
         // Do THE deed.
         $actual = self::$lss->wp_login($this->user_name, $this->user);
     } catch (Exception $e) {
         $this->fail($e->getMessage());
     }
     $this->assertSame(5, $actual, 'Bad return value.');
     $actual = self::$lss->get_pw_force_change($this->user->ID);
     $this->assertFalse($actual, 'get_pw_force_change() return value...');
     $this->check_mail_file();
 }