You are here

protected function SwiftMailerTestBase::assertSubject in Swift Mailer 8.2

Checks the subject of the most recently sent email.

Parameters

string $value: Text to check for.

2 calls to SwiftMailerTestBase::assertSubject()
RealMailTest::testContact in tests/src/Functional/RealMailTest.php
Tests contact form messages.
RealMailTest::testUser in tests/src/Functional/RealMailTest.php
Tests user account messages.

File

tests/src/Functional/SwiftMailerTestBase.php, line 66

Class

SwiftMailerTestBase
Base class for swiftmailer web tests.

Namespace

Drupal\Tests\swiftmailer\Functional

Code

protected function assertSubject($value) {
  $captured_emails = $this->container
    ->get('state')
    ->get('system.test_mail_collector') ?: [];
  $email = end($captured_emails);
  $this
    ->assertEquals($value, (string) $email['subject']);
}