diff --git a/config/phpactor/phpactor.yml b/config/phpactor/phpactor.yml new file mode 100644 index 00000000..9b11d77b --- /dev/null +++ b/config/phpactor/phpactor.yml @@ -0,0 +1,4 @@ +code_transform.class_new.variants: + drupal-functional-test: drupal-functional-test + drupal-kernel-test: drupal-kernel-test + drupal-unit-test: drupal-unit-test diff --git a/config/phpactor/templates/drupal-functional-test/SourceCode.php.twig b/config/phpactor/templates/drupal-functional-test/SourceCode.php.twig new file mode 100644 index 00000000..08340a28 --- /dev/null +++ b/config/phpactor/templates/drupal-functional-test/SourceCode.php.twig @@ -0,0 +1,21 @@ +<?php + +declare(strict_types=1); + +namespace {{ prototype.namespace }}; + +use Drupal\Tests\BrowserTestBase; + +{% for class in prototype.classes %} +final class {{ class.name }} extends BrowserTestBase { + + public $defaultTheme = 'stark'; + + public static $modules = []; + + public function setUp(): void { + parent::setUp(); + } + +} +{% endfor %} diff --git a/config/phpactor/templates/drupal-kernel-test/SourceCode.php.twig b/config/phpactor/templates/drupal-kernel-test/SourceCode.php.twig new file mode 100644 index 00000000..ce136fdd --- /dev/null +++ b/config/phpactor/templates/drupal-kernel-test/SourceCode.php.twig @@ -0,0 +1,21 @@ +<?php + +declare(strict_types=1); + +namespace {{ prototype.namespace }}; + +use Drupal\KernelTests\KernelTestBase; + +{% for class in prototype.classes %} +final class {{ class.name }} extends KernelTestBase { + + public static $modules = []; + + protected $strictConfigSchema = FALSE; + + public function setUp(): void { + parent::setUp(); + } + +} +{% endfor %} diff --git a/config/phpactor/templates/drupal-unit-test/SourceCode.php.twig b/config/phpactor/templates/drupal-unit-test/SourceCode.php.twig new file mode 100644 index 00000000..b797a61a --- /dev/null +++ b/config/phpactor/templates/drupal-unit-test/SourceCode.php.twig @@ -0,0 +1,13 @@ +<?php + +declare(strict_types=1); + +namespace {{ prototype.namespace }}; + +use Drupal\Tests\UnitTestCase; + +{% for class in prototype.classes %} +final class {{ class.name }} extends UnitTestCase { + +} +{% endfor %} diff --git a/home-manager/modules/common.nix b/home-manager/modules/common.nix index 2bedce54..bed16718 100644 --- a/home-manager/modules/common.nix +++ b/home-manager/modules/common.nix @@ -236,4 +236,9 @@ in source = ../../config/neovim; recursive = true; }; + + xdg.configFile.phpactor = { + source = ../../config/phpactor; + recursive = true; + }; }