Skip to content

Codex/php84 compat tests#11

Merged
callinmullaney merged 3 commits into
release-2from
codex/php84-compat-tests
May 4, 2026
Merged

Codex/php84 compat tests#11
callinmullaney merged 3 commits into
release-2from
codex/php84-compat-tests

Conversation

@callinmullaney
Copy link
Copy Markdown
Collaborator

@callinmullaney callinmullaney commented May 4, 2026

This PR does the following:

  • Updates Emulsify Tools to require PHP 8.4+.
  • Updates the README compatibility notes to document Drupal 11.3+, PHP 8.4+, and Drush 13+ expectations.
  • Adds a GitHub Actions PHP compatibility workflow that runs PHP linting against PHP 8.4 and 8.5.
  • Updates ThemeNamespaceRegistry to better protect default Drupal module/theme Twig namespaces while allowing intentional namespace reuse.
  • Adds support for components.allow_default_namespace_reuse to opt into reusing an extension’s default namespace.
  • Allows namespace reuse when an extension explicitly defines its own matching namespace in components.namespaces.
  • Refactors several new Finder() usages to use PHP 8.4-compatible syntax without unnecessary wrapping parentheses.
  • Adds unit test coverage for BemTwigExtension.
  • Adds unit test coverage for TwigAttributeManager.
  • Adds unit test coverage for SubThemeGenerator.
  • Adds unit test coverage for namespaced Twig template validation in ThemeNamespaceRegistry.

Related Issue(s)

  • N/A

Notes:

  • This PR builds on the release-2 branch and assumes the Drupal 11.3+, PHP 8.4+, and Drush 13+ compatibility direction from that release line.
  • The PHP compatibility workflow currently runs PHP syntax linting only; it does not run the full PHPUnit test suite.
  • The namespace protection changes intentionally preserve default Drupal namespace safety while allowing explicit opt-in reuse through components.allow_default_namespace_reuse.

Functional Testing:

  • Confirm Composer accepts the package on PHP 8.4+.
  • Confirm Composer rejects or flags incompatible PHP versions below 8.4.
  • Run composer install.
  • Enable the module in a Drupal 11.3+ site with drush en emulsify_tools -y.
  • Rebuild caches with drush cr.
  • Confirm the site rebuilds the service container without PHP errors.
  • Confirm the GitHub Actions PHP Compatibility workflow runs on the PR.
  • Confirm the PHP Compatibility workflow passes for PHP 8.4.
  • Confirm the PHP Compatibility workflow passes for PHP 8.5.
  • Run PHP linting locally with git ls-files '*.php' | xargs -n 1 php -l.
  • Run the available PHPUnit test suite.
  • Confirm BemTwigExtensionTest passes.
  • Confirm TwigAttributeManagerTest passes.
  • Confirm SubThemeGeneratorTest passes.
  • Confirm ThemeNamespaceRegistryTest passes.
  • Generate a subtheme with drush emulsify "Test Theme".
  • Confirm the generated theme appears at themes/custom/test_theme.
  • Confirm generated files, directories, and contents are renamed from the starter theme machine name to test_theme.
  • Confirm generation fails with a clear exception when the starter source does not contain a *.info.emulsify.yml file.
  • Add a custom components.namespaces entry to a test theme and confirm namespaced Twig templates still resolve correctly.
  • Attempt to define a namespace that conflicts with an installed module or theme namespace and confirm it is protected unless explicitly allowed.
  • Add components.allow_default_namespace_reuse to an extension and confirm its default namespace can be reused.
  • Define a matching namespace under components.namespaces and confirm that namespace reuse is allowed.
  • Confirm malformed namespaced Twig references still fail validation.
  • Confirm supported namespaced template extensions still include .twig, .html, and .svg.
  • Confirm unsupported namespaced template extensions, such as .php, are rejected.

Security

Security checks that should be reviewed

  • Confirm protected Drupal module/theme Twig namespaces cannot be shadowed unintentionally.
  • Confirm namespace reuse is only allowed when explicitly opted into through components.allow_default_namespace_reuse or a matching namespace definition.
  • Confirm namespaced template validation continues to reject malformed template names and unsupported file extensions.
  • Confirm the subtheme generator only renames and rewrites files inside the generated theme directory.
  • Confirm PHP 8.4+ syntax changes do not alter runtime behavior beyond compatibility/readability improvements.

Accessibility

Should this be checked for this feature?

  • No dedicated accessibility review is required for the PHP compatibility workflow, Composer constraint, unit tests, or namespace protection changes.
  • Spot check rendered templates that rely on theme-defined Twig namespaces to confirm expected markup, classes, IDs, ARIA attributes, and semantic structure are preserved.

@callinmullaney callinmullaney merged commit 055fb4e into release-2 May 4, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant