diff --git a/browsertest-convert.php b/browsertest-convert.php new file mode 100644 index 0000000..0cd825b --- /dev/null +++ b/browsertest-convert.php @@ -0,0 +1,628 @@ +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); + } + + file_put_contents("$browsertest_dir/$file_name", $file_content); + + + // Keep existing base classes. + if (strpos($simpletest_file_path, 'Base.php') === FALSE) { + unlink($simpletest_file_path); + } + } + + + print "Tests converted for module $module_name.\n"; +} diff --git a/core/modules/action/src/Tests/ActionListTest.php b/core/modules/action/tests/src/Functional/ActionListTest.php similarity index 87% rename from core/modules/action/src/Tests/ActionListTest.php rename to core/modules/action/tests/src/Functional/ActionListTest.php index f533cdf..2510e86 100644 --- a/core/modules/action/src/Tests/ActionListTest.php +++ b/core/modules/action/tests/src/Functional/ActionListTest.php @@ -1,15 +1,15 @@