You are here

public function SMTPConfigFormTest::testBuildFormEnabledMessage in SMTP Authentication Support 8

Test if enabled message is properly shown.

File

tests/src/Unit/SMTPConfigFormTest.php, line 88

Class

SMTPConfigFormTest
Validate requirements for SMTPConfigForm.

Namespace

Drupal\Tests\smtp\Unit

Code

public function testBuildFormEnabledMessage() {
  $this
    ->setDefaultConfig();
  $this->mockConfig
    ->get('smtp_on')
    ->willReturn(TRUE);
  $formBuilder = SMTPConfigForm::create($this->mockContainer
    ->reveal());
  $form = [];
  $formBuilder
    ->buildForm($form, new FormState());
  $this->mockMessenger
    ->addMessage(Argument::which('getUntranslatedString', 'SMTP module is active.'))
    ->shouldHaveBeenCalled();
}