diff --git a/core/modules/system/tests/src/Kernel/Mail/MailTest.php b/core/modules/system/tests/src/Kernel/Mail/MailTest.php index f8b9a39..ddf2577 100644 --- a/core/modules/system/tests/src/Kernel/Mail/MailTest.php +++ b/core/modules/system/tests/src/Kernel/Mail/MailTest.php @@ -1,6 +1,6 @@ installEntitySchema('file'); + $this->installSchema('system', 'mail'); + } + + /** * Assert that the pluggable mail system is functional. */ public function testPluggableFramework() { @@ -44,7 +51,7 @@ public function testPluggableFramework() { // Assert whether the default mail backend is an instance of the expected // class. - $this->assertTrue($mail_backend instanceof TestPhpMailFailure, 'Default mail interface can be swapped.'); + $this->assertInstanceOf(TestPhpMailFailure::class, $mail_backend, 'Default mail interface can be swapped.'); // Add a module-specific mail backend. $this->config('system.mail')->set('interface.mymodule_testkey', 'test_mail_collector')->save(); @@ -54,7 +61,7 @@ public function testPluggableFramework() { // Assert whether the added mail backend is an instance of the expected // class. - $this->assertTrue($mail_backend instanceof TestMailCollector, 'Additional mail interfaces can be added.'); + $this->assertInstanceOf(TestMailCollector::class, $mail_backend, 'Additional mail interfaces can be added.'); } /** @@ -98,8 +105,8 @@ public function testFromAndReplyToHeader() { // and default sender email. $captured_emails = \Drupal::state()->get('system.test_mail_collector'); $sent_message = end($captured_emails); - $this->assertEqual($from_email, $sent_message['headers']['From'], 'Message is sent from the site email account.'); - $this->assertEqual($reply_email, $sent_message['headers']['Reply-to'], 'Message reply-to headers are set.'); + $this->assertEquals($from_email, $sent_message['headers']['From'], 'Message is sent from the site email account.'); + $this->assertEquals($reply_email, $sent_message['headers']['Reply-to'], 'Message reply-to headers are set.'); $this->assertFalse(isset($sent_message['headers']['Errors-To']), 'Errors-to header must not be set, it is deprecated.'); // Test that long site names containing characters that need MIME encoding