diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d06804671fb3de6d0c25fba46e1c5a3975ba9050..1d234297765c87ae1bd91b78b1c00083d4047fc0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ include: - - project: 'gitlab-ci-cd/composer-packages' + - project: 'gitlab-ci-cd/drupal' ref: main - file: '/composer-packages.yml' + file: '/private-modules.yml' diff --git a/composer.json b/composer.json index d84c86b4cf69e0207a2c9530b326445336cdcb57..7edcb1f80821f533778072a8e570d7f75ebf525f 100644 --- a/composer.json +++ b/composer.json @@ -35,12 +35,6 @@ "source": "https://gitlab.lakedrops.com/composer/plugin/drupal-development-environment/tree/main", "docs": "https://devops-tools.docs.lakedrops.com/composer/plugin/drupal-dev-environment/" }, - "repositories": [ - { - "type": "composer", - "url": "https://packages.drupal.org/8" - } - ], "require": { "php": ">=8.1", "composer-plugin-api": "^2", @@ -76,8 +70,11 @@ "composer/composer": "^2", "roave/security-advisories": "dev-latest" }, - "minimum-stability": "dev", - "prefer-stable": true, + "config": { + "allow-plugins": { + "lakedrops/*": false + } + }, "autoload": { "psr-4": { "LakeDrops\\DrupalDevelopmentEnvironment\\": "src/" @@ -85,14 +82,5 @@ }, "extra": { "class": "LakeDrops\\DrupalDevelopmentEnvironment\\Plugin" - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true, - "drupal/core-composer-scaffold": false, - "lakedrops/*": false, - "php-http/discovery": false, - "phpstan/extension-installer": true - } } } diff --git a/src/Plugin.php b/src/Plugin.php index e88a62b55be74b19fcedf364908d0ef717a62ca9..6430c041002bde5154fe0075493616be54921959 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -75,11 +75,10 @@ class Plugin extends BasePlugin { * The event that triggered the plugin. */ public function prepareProject(Event $event): void { - /** @var Handler $handler */ + /** @var \LakeDrops\DrupalDevelopmentEnvironment\Handler $handler */ $handler = $this->handler; - $handler - ->setEvent($event) - ->setupLakeDropsProject(); + $handler->setEvent($event); + $handler->setupLakeDropsProject(); } } diff --git a/src/TestSuite/Base.php b/src/TestSuite/Base.php index 4309435c3b9d93224850e244b2ae38ed3f51f854..a4e4176aa10d5245955bf9613d09f6fc0421eefc 100644 --- a/src/TestSuite/Base.php +++ b/src/TestSuite/Base.php @@ -12,6 +12,13 @@ use Drupal\Tests\TestSuites\TestSuiteBase; */ abstract class Base extends TestSuiteBase { + /** + * Unused variable to allow for otherwise useless __construct overrides. + * + * @var string + */ + protected string $internalTestType; + /** * Finds extensions in a Drupal installation. * diff --git a/src/TestSuite/Functional.php b/src/TestSuite/Functional.php index ddfd8492eef56b92da18429b2d844790eb579afb..a7178978ddedc2f4af81851f1ea066fac958e4ae 100644 --- a/src/TestSuite/Functional.php +++ b/src/TestSuite/Functional.php @@ -9,13 +9,21 @@ require_once __DIR__ . '/Base.php'; */ class Functional extends Base { + /** + * {@inheritdoc} + */ + final public function __construct($theClass = '', string $name = '') { + parent::__construct($theClass, $name); + $this->internalTestType = 'functional'; + } + /** * Factory method which loads up a suite with all functional tests. * * @return static * The test suite. */ - public static function suite(): Functional { + public static function suite(): static { $root = dirname(__DIR__, 5) . '/web'; $suite = new static('functional'); diff --git a/src/TestSuite/FunctionalJavascript.php b/src/TestSuite/FunctionalJavascript.php index 4f4e95f6cde131b78bf800d9b50b058cc26ac380..9d7fdf87aa76a23dafa697e3f8cd803a5fb25dfe 100644 --- a/src/TestSuite/FunctionalJavascript.php +++ b/src/TestSuite/FunctionalJavascript.php @@ -9,13 +9,21 @@ require_once __DIR__ . '/Base.php'; */ class FunctionalJavascript extends Base { + /** + * {@inheritdoc} + */ + final public function __construct($theClass = '', string $name = '') { + parent::__construct($theClass, $name); + $this->internalTestType = 'functional javascript'; + } + /** * Factory method which loads up a suite with all functional tests. * * @return static * The test suite. */ - public static function suite(): FunctionalJavascript { + public static function suite(): static { $root = dirname(__DIR__, 5) . '/web'; $suite = new static('functional-javascript'); diff --git a/src/TestSuite/Kernel.php b/src/TestSuite/Kernel.php index 63ee49e86e878e0b0f757a5895fe932a0c892897..457bdfc8694e0eab0bb72f71524a6e88770530db 100644 --- a/src/TestSuite/Kernel.php +++ b/src/TestSuite/Kernel.php @@ -9,13 +9,21 @@ require_once __DIR__ . '/Base.php'; */ class Kernel extends Base { + /** + * {@inheritdoc} + */ + final public function __construct($theClass = '', string $name = '') { + parent::__construct($theClass, $name); + $this->internalTestType = 'kernel'; + } + /** * Factory method which loads up a suite with all unit tests. * * @return static * The test suite. */ - public static function suite(): Kernel { + public static function suite(): static { $root = dirname(__DIR__, 5) . '/web'; $suite = new static('kernel'); diff --git a/src/TestSuite/Unit.php b/src/TestSuite/Unit.php index bcad233d55d44a6b5d95635df56bee6ed22985f9..4a0d09a214ab85a8c9635ef2daf0a08760763ee0 100644 --- a/src/TestSuite/Unit.php +++ b/src/TestSuite/Unit.php @@ -9,13 +9,21 @@ require_once __DIR__ . '/Base.php'; */ class Unit extends Base { + /** + * {@inheritdoc} + */ + final public function __construct($theClass = '', string $name = '') { + parent::__construct($theClass, $name); + $this->internalTestType = 'unit'; + } + /** * Factory method which loads up a suite with all unit tests. * * @return static * The test suite. */ - public static function suite(): Unit { + public static function suite(): static { $root = dirname(__DIR__, 5) . '/web'; $suite = new static('unit');