From dcaf0a41416424648718f7d7e20a7c8fccbc3548 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 20 Mar 2026 14:36:37 +0100 Subject: [PATCH 1/4] Fix CI --- composer.json | 4 ++-- phpunit.xml | 3 +++ tests/functional/Generator/Yaml/_module_info/example.info.yml | 2 +- tests/functional/Generator/_module/bar/bar.info.yml | 2 +- tests/functional/Generator/_module/foo/foo.info.yml | 2 +- tests/functional/Generator/_theme/foo/foo.info.yml | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 61950e1c8..d63d96267 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "ext-simplexml": "*", "chi-teck/drupal-coder-extension": "^2.0.0-rc2", "drupal/coder": "8.3.24", - "drupal/core": "11.x-dev", + "drupal/core": "11.x-dev || 12.x-dev", "phpspec/prophecy-phpunit": "^2.2", "phpunit/phpunit": "^10.5", "squizlabs/php_codesniffer": "^3.9", @@ -49,6 +49,6 @@ "squizlabs/php_codesniffer": "<3.6", "nikic/php-parser": "<4.17" }, - "minimum-stability": "RC", + "minimum-stability": "dev", "prefer-stable": true } diff --git a/phpunit.xml b/phpunit.xml index c054a88b3..03c4fd82f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -4,6 +4,9 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" colors="true" processIsolation="true"> + + + ./tests/unit diff --git a/tests/functional/Generator/Yaml/_module_info/example.info.yml b/tests/functional/Generator/Yaml/_module_info/example.info.yml index e2dae2a43..9a202d4d1 100644 --- a/tests/functional/Generator/Yaml/_module_info/example.info.yml +++ b/tests/functional/Generator/Yaml/_module_info/example.info.yml @@ -2,7 +2,7 @@ name: Example type: module description: Example description. package: Custom -core_version_requirement: ^10 || ^11 +core_version_requirement: ^10 || ^11 || ^12 dependencies: - views - node diff --git a/tests/functional/Generator/_module/bar/bar.info.yml b/tests/functional/Generator/_module/bar/bar.info.yml index 2aa653ae4..7f1809ce2 100644 --- a/tests/functional/Generator/_module/bar/bar.info.yml +++ b/tests/functional/Generator/_module/bar/bar.info.yml @@ -2,7 +2,7 @@ name: 'Bar' type: module description: 'Some description.' package: Custom -core_version_requirement: ^10 || ^11 +core_version_requirement: ^10 || ^11 || ^12 dependencies: - drupal:node - drupal:system diff --git a/tests/functional/Generator/_module/foo/foo.info.yml b/tests/functional/Generator/_module/foo/foo.info.yml index e5a3c36c1..c53f66637 100644 --- a/tests/functional/Generator/_module/foo/foo.info.yml +++ b/tests/functional/Generator/_module/foo/foo.info.yml @@ -2,6 +2,6 @@ name: 'Foo' type: module description: 'Some description.' package: Custom -core_version_requirement: ^10 || ^11 +core_version_requirement: ^10 || ^11 || ^12 dependencies: - drupal:views diff --git a/tests/functional/Generator/_theme/foo/foo.info.yml b/tests/functional/Generator/_theme/foo/foo.info.yml index bab00c24b..b7700cfd6 100644 --- a/tests/functional/Generator/_theme/foo/foo.info.yml +++ b/tests/functional/Generator/_theme/foo/foo.info.yml @@ -3,7 +3,7 @@ type: theme base theme: bartik description: Some description. package: Custom -core_version_requirement: ^10 || ^11 +core_version_requirement: ^10 || ^11 || ^12 libraries: - foo/global regions: From 4d3bcbd8264682bcf5926fcec274792f24e10eec Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 20 Mar 2026 14:41:07 +0100 Subject: [PATCH 2/4] Allow drupal/core-composer-scaffold --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d63d96267..b1574564a 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "config": { "sort-packages": true, "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "drupal/core-composer-scaffold": true } }, "require": { From aa42a5961a25542516bafdd2539f2e7b420b2eac Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 20 Mar 2026 14:48:20 +0100 Subject: [PATCH 3/4] Replace add with addCommand, fixes lint step --- composer.json | 2 +- src/Application.php | 2 +- src/Test/Functional/GeneratorTestBase.php | 2 +- src/Test/GeneratorTest.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index b1574564a..439020547 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "sort-packages": true, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, - "drupal/core-composer-scaffold": true + "drupal/core-composer-scaffold": false } }, "require": { diff --git a/src/Application.php b/src/Application.php index 350c280bc..0fa7080c9 100644 --- a/src/Application.php +++ b/src/Application.php @@ -113,7 +113,7 @@ public static function create(ContainerInterface $container): self { $application->dispatch(new GeneratorInfoAlter($all_generators))->generators, ); - $application->add(new Navigation()); + $application->addCommand(new Navigation()); $application->setDefaultCommand('navigation'); /** @var \DrupalCodeGenerator\Application $application */ diff --git a/src/Test/Functional/GeneratorTestBase.php b/src/Test/Functional/GeneratorTestBase.php index feaf140af..49f12c336 100644 --- a/src/Test/Functional/GeneratorTestBase.php +++ b/src/Test/Functional/GeneratorTestBase.php @@ -42,7 +42,7 @@ protected function execute(string $command_class, array $user_input): int { ->getInstanceFromDefinition($command_class); \assert($command instanceof Command); - $application->add($command); + $application->addCommand($command); $command_tester = new CommandTester($command); /** @psalm-var int<0, 1> $result */ diff --git a/src/Test/GeneratorTest.php b/src/Test/GeneratorTest.php index d3f67063d..fcc7ec365 100644 --- a/src/Test/GeneratorTest.php +++ b/src/Test/GeneratorTest.php @@ -58,7 +58,7 @@ protected function tearDown(): void { * stream. */ protected function execute(Command $command, array $user_input): int { - $this->createApplication()->add($command); + $this->createApplication()->addCommand($command); $command_tester = new CommandTester($command); $result = $command_tester From caa98e197d12d90fe1e4b6dfef669fe413206ee2 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 20 Mar 2026 15:09:25 +0100 Subject: [PATCH 4/4] Remove Contact message and Shortcut link are no longer in core --- .../Entity/EntityBundleClassTest.php | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/tests/functional/Generator/Entity/EntityBundleClassTest.php b/tests/functional/Generator/Entity/EntityBundleClassTest.php index 2dcd6d2f4..81b85756b 100644 --- a/tests/functional/Generator/Entity/EntityBundleClassTest.php +++ b/tests/functional/Generator/Entity/EntityBundleClassTest.php @@ -40,16 +40,14 @@ public function testSingleBundleWithoutBaseClass(): void { ➤ Entity type: - [ 1] Content block - [ 2] Comment - [ 3] Contact message - [ 4] File - [ 5] Custom menu link - [ 6] Content - [ 7] URL alias - [ 8] Shortcut link - [ 9] Taxonomy term - [10] User + [1] Content block + [2] Comment + [3] File + [4] Custom menu link + [5] Content + [6] URL alias + [7] Taxonomy term + [8] User ➤ Bundles, comma separated: @@ -104,16 +102,14 @@ public function testAllBundlesWithBaseClass(): void { ➤ Entity type: - [ 1] Content block - [ 2] Comment - [ 3] Contact message - [ 4] File - [ 5] Custom menu link - [ 6] Content - [ 7] URL alias - [ 8] Shortcut link - [ 9] Taxonomy term - [10] User + [1] Content block + [2] Comment + [3] File + [4] Custom menu link + [5] Content + [6] URL alias + [7] Taxonomy term + [8] User ➤ Bundles, comma separated: