Currently This module still contains one simpletest.

This should be converted to a PHPUnit test since simpletest is deprecated and will be removed in Drupal 9.

Comments

JeroenT created an issue. See original summary.

jeroent’s picture

StatusFileSize
new10.32 KB

Patch attached converts the simpletest to a PHPUnit FunctionalJavascript test and fixes a deprecation notice.

jeroent’s picture

StatusFileSize
new21.06 KB

Test did not run because of a typo in the filename...

jeroent’s picture

StatusFileSize
new10.32 KB

And now the right patch. (The previous patch as added to the patch - patcheption)

jeroent’s picture

berdir’s picture

Status: Needs review » Needs work
Issue tags: +Drupal 9 compatibility, +Novice

Looks fine to me, just one nitpick, lets include the $defaultTheme = 'stark' definition in the new test so we don't have to update it again?

akashkumar07’s picture

Status: Needs work » Needs review
StatusFileSize
new10.39 KB

Added $defaultTheme = 'stark' in test. Please review.

berdir’s picture

Status: Needs review » Needs work
  1. +++ b/tests/src/FunctionalJavascript/SwiftMailerSettingsTest.php
    @@ -0,0 +1,140 @@
    +  /**
    +   * {@inheritdoc}
    +   */
    +  protected $defaultTheme = 'stark';
    +  ¶
    +  /**
    +   * Modules to enable.
    

    extra spaces.

  2. +++ b/tests/src/FunctionalJavascript/SwiftMailerSettingsTest.php
    @@ -0,0 +1,140 @@
    +
    +  protected $adminUser;
    

    lets add a docblock for this while moving it around. Admin user as description and @var \Drupal\user\UserInterface.

Make sure you select a compatible PHP version when adding a test.

akashkumar07’s picture

Status: Needs work » Needs review
StatusFileSize
new10.47 KB

Made suggested changes. Please review.

berdir’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/tests/src/FunctionalJavascript/SwiftMailerSettingsTest.php
@@ -0,0 +1,145 @@
+  /**
+   * The user object.
+   *
+   * @var \Drupal\user\UserInterface.
+   */
+  protected $adminUser;

no . at the end of @var, but that can be fixed on commit.

More importantly, when making changes to an existing patch, always provide an interdiff, so it is easier to review.

adamps’s picture

Assigned: Unassigned » adamps
berdir’s picture

StatusFileSize
new10.02 KB

Reroll, without the test theme change.

berdir’s picture

Ok, so this now actually fails because I forgot to add the key to the mailsystem test theme, will need to fix that.

This passes on 8.8, so I think you could also commit it.

  • AdamPS committed ea3625a on 8.x-2.x authored by JeroenT
    Issue #3093209 by JeroenT, AkashkumarOSL, Berdir: Convert simpletest to...
adamps’s picture

Status: Reviewed & tested by the community » Fixed

Agree, committed.

I reopened #3096960: Drupal 9 deprecated code report for the remaining error in mailsystem_test_theme.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.