diff --git a/browsertest-convert.php b/browsertest-convert.php index 65c0dbe..a2c3dfb 100644 --- a/browsertest-convert.php +++ b/browsertest-convert.php @@ -121,6 +121,7 @@ 'NodeViewTest', 'ShortcutLinksTest', 'TermTest', + 'TermAutocompleteTest', 'UserAccountLinksTest', // @todo ... there are more @@ -555,7 +556,7 @@ function glob_recursive($pattern, $flags = 0) { continue; } // REST tests are not converted yet. - if (strpos($file_content, ' extends RestTestBase {') !== FALSE) { + if (strpos($file_content, ' extends RESTTestBase {') !== FALSE) { continue; } // Module tests should be refactored into kernel and browser tests. @@ -598,6 +599,12 @@ function glob_recursive($pattern, $flags = 0) { // Fix use statements for base classes. str_replace("use Drupal\\system\\Tests\\Cache\\PageCacheTagsTestBase;", "use Drupal\\Tests\\system\\Functional\\Cache\\PageCacheTagsTestBase;", $file_content); + // Use AssertMailTrait where needed. + if (strpos($file_content, '$this->drupalGetMails(') !== FALSE) { + $file_content = str_replace(" extends BrowserTestBase {", " extends BrowserTestBase {\n use AssertMailTrait {\n getMails as drupalGetMails;\n }", $file_content); + $file_content = str_replace("use Drupal\\Tests\\BrowserTestBase;", "use Drupal\\Tests\\BrowserTestBase;\nuse Drupal\Core\Test\AssertMailTrait;", $file_content); + } + $test_dir = dirname("$browsertest_dir/$file_name"); if (!file_exists($test_dir)) { mkdir($test_dir, 0777, TRUE); diff --git a/core/modules/dblog/tests/src/Functional/Rest/DbLogResourceTest.php b/core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php similarity index 98% rename from core/modules/dblog/tests/src/Functional/Rest/DbLogResourceTest.php rename to core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php index ad75e63..279d202 100644 --- a/core/modules/dblog/tests/src/Functional/Rest/DbLogResourceTest.php +++ b/core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php @@ -1,6 +1,6 @@