Problem/Motivation

Is it too early to be concerned about getting the codebase ready for Drupal 12? Probably. But as a fun exercise I went down that rabbit hole today and came up with a repo to share with you. Fixed:

  1. Update the .info.yml to support 12
  2. D12 updates the supported version of phpunit so fix the phpunit.xml and fix some tests
  3. Test fixed: CloudFlarePurgeApiTest use PHP 8 attribute
  4. Test fixed: CloudflarePurgeByUrlTest use PHP 8 attribute
  5. Purge.php: Handle deprecations on the use of \Drupal:state(). Wire state into the serve by updating cloudflare_purge.services.yml
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

cosmicdreams created an issue. See original summary.

cosmicdreams’s picture

Status: Active » Needs review
flashwebcenter’s picture

Title: Drupal 12 Readiness » Modernize PHPUnit config, test annotations, and state injection
Status: Needs review » Fixed

Thanks for going down that rabbit hole. Perfect timing. I reviewed your changes and merged most of them.

Merged in:
PHPUnit XML updated (schema, source element, removed deprecated attributes)
CloudFlarePurgeApiTest and CloudflarePurgeByUrlTest converted to PHP 8 #[CoversClass]
Replaced the \Drupal::state() deprecation with constructor injection via cloudflare_purge.services.yml

Holding off on:
The ^12 core constraint in info.yml and composer.json. I’d rather wait until Drupal 12 is released and I’ve tested before declaring compatibility.

Appreciate the work. The PHPUnit and deprecation fixes are solid improvements either way.

Best wishes,
Alaa

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.