Drupal Code Builder 4.6.11 Adds PHPUnit Attributes for Drupal 12
Released on 28 September 2026, Drupal Code Builder 4.6.11 adds PHPUnit attributes to generated test classes and fixes several scaffold-generation errors. Maintainer Joachim Noreiko described the update as a set of minor bug fixes, with the test-generation change preparing generated code for Drupal 12.
Drupal's testing framework has been moving from doc-comment annotations to PHP attributes as PHPUnit drops annotation support. PHPUnit 12 no longer supports metadata supplied through those annotations, and Drupal 11.3 also requires the #[RunTestsInSeparateProcesses] attribute on concrete Kernel, Functional and FunctionalJavascript test classes. Code Builder 4.6.11 updates generated tests accordingly.
The release also fixes a crash and related errors when a service selected for dependency injection is no longer present in site analysis data. Generated Drush command methods now handle command names containing hyphens correctly, while another fix addresses plugin types that use a plugin definition class.
A separate correction prevents quoted numeric PHP values from being rendered as strings when generated code expects a numeric value. Internal changes also add detection for configurable plugin interfaces and move plugin-class fetching into a helper method.
Noreiko said he is also working on improved name generation for plugins and services, as well as support for configurable plugins. Those changes will take longer, he wrote, so he released the bug fixes separately rather than waiting for the larger work.
Drupal Code Builder generates scaffold code for Drupal modules and components, including hooks, plugins, services, entity types and test classes. It can be used through the Drupal Module Builder project or through its Drush command extension.
References
-
-
-
-
#[RunTestsInSeparateProcesses] attribute is required for all Kernel, Functional and FunctionalJavascript tests, Drupal.org (13 October 2025)

