You are here

public function RerouteEmailTestBase::assertEmailNotReroutedFromTestForm in Reroute Email 2.x

Submit test email form and assert not rerouting.

Parameters

array $post: An array of post data: 'to', 'cc', 'bcc', 'subject', 'body'.

Throws

\Behat\Mink\Exception\ResponseTextException

1 call to RerouteEmailTestBase::assertEmailNotReroutedFromTestForm()
TestEmailFormTest::testEmailWithDisplayName in tests/src/Functional/TestEmailFormTest.php
Test for reroute_email display name supporting.

File

tests/src/Functional/RerouteEmailTestBase.php, line 201

Class

RerouteEmailTestBase
Base test class for Reroute Email test cases.

Namespace

Drupal\Tests\reroute_email\Functional

Code

public function assertEmailNotReroutedFromTestForm(array $post) : void {

  // Submit the test form.
  $this
    ->drupalGet('admin/config/development/reroute_email/test');
  $this
    ->submitForm($post, $this
    ->t('Send email'));
  $this
    ->assertSession()
    ->pageTextContains($this
    ->t('Test email submitted for delivery from test form.'));

  // Check not rerouted email.
  $this
    ->assertMail('to', $post['to'], new FormattableMarkup('An email was properly sent to the email address: @destination.', [
    '@destination' => $post['to'],
  ]));
}