LoginSecurityEmailTest.php in Login Security 8
File
src/Tests/LoginSecurityEmailTest.php
View source
<?php
namespace Drupal\login_security\Tests;
use Drupal\Core\Form\FormState;
class LoginSecurityEmailTest extends LoginSecurityTestBase {
public static $modules = [
'user',
'login_security',
];
protected $account;
public function setUp() {
parent::setUp();
$this
->drupalCreateUser();
$this->account = $this
->drupalCreateUser();
$this
->drupalLoginLite($this->account);
\Drupal::configFactory()
->getEditable('login_security.settings')
->set('user_blocked_notification_emails', 'test@test.com')
->set('login_activity_notification_emails', 'test@test.com')
->save();
}
public function testBlockedEmail() {
$variables = [
'@uid' => $this->account
->id(),
];
$form_state = new FormState();
login_user_block_user_name($variables, $form_state);
$this
->assertMail('to', 'test@test.com', 'Mail sent when a user is blocked.');
}
public function testActivityThresholdEmail() {
}
}