feat(nvim): add Phpactor templates for Drupal tests

This commit is contained in:
Oliver Davies 2023-05-10 12:20:55 +01:00
parent fdd48ba14d
commit 1e22556f6a
5 changed files with 64 additions and 0 deletions

View file

@ -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

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -236,4 +236,9 @@ in
source = ../../config/neovim;
recursive = true;
};
xdg.configFile.phpactor = {
source = ../../config/phpactor;
recursive = true;
};
}